Bug 838374

Summary: SELinux is preventing /usr/bin/gdb from using the ptrace access on a gdm-simple-slave with xdm_t
Product: [Fedora] Fedora Reporter: Wendell Baker <wendellcraigbaker>
Component: gdmAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: agrimm, rstrode
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-01 10:18:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wendell Baker 2012-07-08 22:11:52 UTC
Description of problem:

This problem report focuses on the invalid use of gdb to ptrace the failing gdm after firstboot.

The sealert is observed after firstboot

Jul  8 13:16:47 handling setroubleshoot: SELinux is preventing /usr/bin/gdb from using the ptrace access on a process. For complete SELinux messages. run sealert -l 30095de9-5cd9-424c-9e20-939c284203a0

After firstboot, gdm or gdm-simple-slave crashes and an attempt is made to fire up gdb to assess the reason.  This too fails.

How reproducible:

deterministic

Steps to Reproduce:
1. Install F17
2. Without triggering firstboot, ssh into the box and remediate (details below)
   a. yum update ...
   b. add some users (useradd, usermod)
   c. d not reboot
4. ssh into the box
5. systemctl enable graphical.target
6. systemctl start graphical.target (never finishes)
7. firstboot runs graphically (workflow screens show, but only a spinning wheel, no gdm login)


Actual results:

$ sudo systemctl enable graphical.target
Failed to issue method call: File exists

$ systemctl start graphical.target (never finishes)
<never finishes>

$ systemctl start graphical.target (never finishes)


Expected results:

smooth bringup, without quirks.  This box-build recipe "used to" work (in the F14 & prior days).  The recipe involves pxeboot, tftp+kickstart localnet nfs repo, vnc install followed by ssh as root to add users, yum update, the moral equivalent of "telinit 5" to bring up the graphics.  This is fully automated from bare metal.

Workaround:
1. run the recipe as described until firstboot "hangs"
2. ssh into the box /sbin/reboot
   a. tail /etc/inittab for the telinit recipe
   b. sudo systemctl enable graphical.target ; : just checking
   c. sudo sudo ln -f -s /lib/systemd/system/graphical.target /etc/systemd/system/default.target
   d. sudo systemctl start graphical.target
   e. see gdm, login


Version-Release number of selected component (if applicable):

*after* yum update and *after* reboot

systemd-44-17.fc17.i686
gdm-3.4.1-3.fc17.i686

Linux handling 3.4.4-5.fc17.i686.PAE #1 SMP Thu Jul 5 20:09:45 UTC 2012 i686 i686 i386 GNU/Linux


Additional info:


audit2why says:

type=AVC msg=audit(1341778607.114:2677): avc:  denied  { ptrace } for  pid=14105 comm="gdb" scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tclass=process

	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.


See also
https://bugzilla.redhat.com/show_bug.cgi?id=828197
systemctl start graphical.target => finishes firstboot but then gdm does not offer a login, only a spinning circle cursor (edit) 

Same problem on F17 from 2012-06-04 (the problem is repeatable).  That problem report focused on the suboptimal error messaging of systemd.  This problem report focuses on the invalid use of gdb to ptrace the failing gdm after firstboot.

Comment 1 Fedora End Of Life 2013-07-04 03:09:09 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2013-08-01 10:18:27 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.