Bug 473042
| Summary: | (staff_u) SELinux prevented bash from using the terminal /dev/pts/0. | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Matěj Cepl <mcepl> |
| Component: | bash | Assignee: | Roman Rakus <rrakus> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | dwalsh, lex.lists, mcepl, rrakus, tsmetana, twaugh |
| Target Milestone: | --- | Keywords: | SELinux |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2009-03-03 20:38:25 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Matěj Cepl
2008-11-26 09:02:02 UTC
You have a terminal labeled unconfined_devpts_t which must have been labeled for a unconfined domain, Are you running an unconfined_t process as root? And for some reason staff_t is trying to write to this terminal. How did you get this to happen? It happens when running sudo -i. I can not recreate. [matej@viklef vimfiles]$ ls -lZ /dev/pts/* crw--w---- matej tty staff_u:object_r:staff_devpts_t /dev/pts/0 crw--w---- matej tty staff_u:object_r:staff_devpts_t /dev/pts/1 [matej@viklef vimfiles]$ getfacl /dev/pts/* getfacl: Removing leading '/' from absolute path names # file: dev/pts/0 # owner: matej # group: tty user::rw- group::-w- other::--- # file: dev/pts/1 # owner: matej # group: tty user::rw- group::-w- other::--- [matej@viklef vimfiles]$ This looks all right, doesn't it? Or is there some swinging of ownership done by ConsoleKit and its likes which makes SELinux unhappy? When you execute sudo -i it changes the label of the terminal from staff_devpts_t to unconfined_devpts_t. So something still running as staff_t tries to write to the terminal after the sudo, which is causing the AVC. Thankfully this goes away in F11. Patch may need updating for bash 4.0 ? There is not much we can do until the next release. If you have a process with an open connection to the terminal as staff_t Then you run sudo to change to unconfined_t, This relabels the terminal, now if the original staff_t writes to the terminal it will generate an AVC. This type of isolation might be justifiable, but they are rather tough to explain to a user. This has been removed in F11 so I am closing until then. |