Bug 907657

Summary: SELinux is preventing /usr/bin/Xorg from unix_read, unix_write access on the shared memory .
Product: [Fedora] Fedora Reporter: maheffa
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:f30f835991b1e8b89cfab24acc6125422f953992b495c4018cb38d8e0039054c
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-06 03:13:29 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description maheffa 2013-02-04 17:47:39 EST
Description of problem:
SELinux is preventing /usr/bin/Xorg from unix_read, unix_write access on the shared memory .

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that Xorg should be allowed unix_read unix_write access on the  shm by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep Xorg /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                 [ shm ]
Source                        Xorg
Source Path                   /usr/bin/Xorg
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xorg-x11-server-Xorg-1.13.2-1.fc18.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.4-204.fc18.i686 #1 SMP Wed Jan
                              23 17:08:59 UTC 2013 i686 i686
Alert Count                   11
First Seen                    2013-02-05 02:39:54 MSK
Last Seen                     2013-02-05 02:44:12 MSK
Local ID                      ffcd0f71-2d28-4f0f-b6c0-d127d0eb5e22

Raw Audit Messages
type=AVC msg=audit(1360017852.869:545): avc:  denied  { unix_read unix_write } for  pid=785 comm="Xorg" key=0  scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=shm


type=SYSCALL msg=audit(1360017852.869:545): arch=i386 syscall=ipc success=no exit=EACCES a0=15 a1=928004 a2=0 a3=bfd3e734 items=0 ppid=770 pid=785 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=Xorg exe=/usr/bin/Xorg subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)

Hash: Xorg,xdm_t,unconfined_t,shm,unix_read,unix_write

audit2allow

#============= xdm_t ==============
#!!!! This avc is allowed in the current policy

allow xdm_t unconfined_t:shm { unix_read unix_write };

audit2allow -R

#============= xdm_t ==============
#!!!! This avc is allowed in the current policy

allow xdm_t unconfined_t:shm { unix_read unix_write };


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.4-204.fc18.i686
type:           libreport

Potential duplicate: bug 804237
Comment 1 Miroslav Grepl 2013-02-05 01:30:38 EST
This looks like something was going wrong on your login, what login program were you using and does it use pam_selinux?
Comment 2 Miroslav Grepl 2013-02-05 01:32:01 EST
*** Bug 907654 has been marked as a duplicate of this bug. ***
Comment 3 Miroslav Grepl 2013-02-05 01:32:08 EST
*** Bug 907656 has been marked as a duplicate of this bug. ***
Comment 4 Miroslav Grepl 2013-02-05 01:32:12 EST
*** Bug 907653 has been marked as a duplicate of this bug. ***
Comment 5 Miroslav Grepl 2013-02-05 01:34:08 EST
*** Bug 907652 has been marked as a duplicate of this bug. ***
Comment 6 maheffa 2013-02-05 02:52:27 EST
The default Fedora 18 login program.
Comment 7 Miroslav Grepl 2013-02-05 04:37:14 EST
Does it happen after every login?
Comment 8 maheffa 2013-02-05 05:54:46 EST
Yes!
Comment 9 maheffa 2013-02-05 06:15:27 EST
Oh, sorry, not every login.
I've rebooted manually, and everything is OK. Since I rarely reboot manually (because the system hang very often at random time, gnome-shell suddenly freeze and cannot move my mouse, cannot enter to text mode (ctrl-alt-f2), so I have to power off from ACPI every time), I thought that it always happens every login.
I still don't know what to do with the system hanging up. It's very random, I can't tell when it happens exactly, or why. I cannot report any bug since it's hanging up. I was trying to ask help on some forums, but nobody could help since I can't tell the source of the problem.
Comment 10 Miroslav Grepl 2013-02-06 03:13:29 EST
It does not look like SELinux issue. You can try to boot with

enforcing=0

as kernel parameter to be sure.
Comment 11 maheffa 2013-02-07 18:17:39 EST
Sorry for taking too long to answer.

I disabled SELinux (SELINUX=disable, hope it's the same thing as enforcing=0), but the system still hung.

Seems like the problem came from nouveau driver. I heard nouveau has some issues with the 3.7 kernel so I installed nvidia driver, and since then, seems like everything is doing well.

If there is a problem I will report.

Thank you for your contribution. :)