Bug 452861 - SELinux is preventing gdb (xdm_t) "write" to ./rpm (rpm_var_lib_t).
SELinux is preventing gdb (xdm_t) "write" to ./rpm (rpm_var_lib_t).
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gdm (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: jmccann
Fedora Extras Quality Assurance
:
: 452862 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-25 09:52 EDT by Jeff Moyer
Modified: 2015-01-14 18:21 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-10 06:47:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Moyer 2008-06-25 09:52:23 EDT
Description of problem:

Summary:

SELinux is preventing gdb (xdm_t) "write" to ./rpm (rpm_var_lib_t).

Detailed Description:

SELinux denied access requested by gdb. It is not expected that this access is
required by gdb and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for ./rpm,

restorecon -v './rpm'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:rpm_var_lib_t:s0
Target Objects                ./rpm [ dir ]
Source                        gdb
Source Path                   /usr/bin/gdb
Port                          <Unknown>
Host                          segfault.boston.devel.redhat.com
Source RPM Packages           gdb-6.8-1.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-42.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     segfault.boston.devel.redhat.com
Platform                      Linux segfault.boston.devel.redhat.com
                              2.6.25-14.fc9.x86_64 #1 SMP Thu May 1 06:06:21 EDT
                              2008 x86_64 x86_64
Alert Count                   98
First Seen                    Tue 24 Jun 2008 09:10:10 AM EDT
Last Seen                     Tue 24 Jun 2008 09:10:23 AM EDT
Local ID                      10c706ae-5ca3-4fcb-b193-0eba369fe068
Line Numbers                  

Raw Audit Messages            

host=segfault.boston.devel.redhat.com type=AVC msg=audit(1214313023.629:247):
avc:  denied  { write } for  pid=3975 comm="gdb" name="rpm" dev=sdb3 ino=30442
scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023
tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir

host=segfault.boston.devel.redhat.com type=SYSCALL
msg=audit(1214313023.629:247): arch=c000003e syscall=21 success=no exit=-13
a0=30565b0 a1=2 a2=0 a3=6fd6a70 items=0 ppid=3974 pid=3975 auid=4294967295 uid=0
gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295
comm="gdb" exe="/usr/bin/gdb" subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)
Comment 1 Daniel Walsh 2008-06-26 08:00:16 EDT
gdm should not be execing gdb
Comment 2 Daniel Walsh 2008-06-26 08:01:15 EDT
*** Bug 452862 has been marked as a duplicate of this bug. ***
Comment 3 Ray Strode [halfline] 2008-06-26 17:17:26 EDT
It does it to get a reasonable backtrace (unlike execinfo.h functions)

Now it shouldn't be crashing, but when it does crash, running gdb isn't a bug.
Comment 4 Daniel Walsh 2008-06-27 07:12:25 EDT
Well then we need to figure out what access it actually needs to get a back
trace.  Giving it the ability to overwrite the rpm database is not a good idea.
Comment 5 Ray Strode [halfline] 2008-06-27 10:31:10 EDT
Yea, I'm not sure why gdb would be trying to do anything with /var/lib/rpm
Comment 6 Ray Strode [halfline] 2008-06-27 10:32:06 EDT
oh thinking about this more, gdb suggests to you which rpms to install to get
debuginfo, so that's probably what's happening.

Probably just need to give it read access to the db.
Comment 7 Daniel Walsh 2008-06-29 08:17:49 EDT
I allow gdm to read rpm database in  selinux-policy-3.3.1-73.fc9.noarch  but I
guess we need to cause gdm to crash to see if this is enough.
Comment 8 Dorothy McElrath 2009-01-14 20:52:46 EST
I received this same message about SELinux preventing gdb from writing to .rpm.  I am a relatively new Fedora user, and I am completely puzzled as to what this is referring to.  I would appreciate any clarification as to what it means and what if anything I should do.  

Thank you.  

Dorothy McElrath
Comment 9 Ray Strode [halfline] 2009-01-15 09:08:04 EST
Hi Dorothy,

GDM is the the login screen you see when you first boot up the machine.  gdb is a debugger that is run when the login screen (or part of the login screen) crashes.  The debugger is able to add some information about why the crash happened.  We don't ship all the packages necessary to get a complete view of that information by default since it can get big.  gdb will try to figure out and report which packages it needs installed to work completely (in case a user is running it instead of a program running it).  

SELinux is a mechanism to secure a system from doing things it isn't supposed to do.  Normally it wouldn't make sense for a debugger to look in /var/lib/rpm so selinux flagged it as suspicious and prevented it from performing the operation.  Looking at /var/lib/rpm is how gdb discovers which packages it needs, though, so it's actually okay that it's looking there. That's why Dan fixed the selinux policy in comment 7.
Comment 10 Daniel Walsh 2009-01-15 10:27:27 EST
Dorothy what was the SELinux message that you saw?
Comment 11 Bug Zapper 2009-06-09 21:47:17 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  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 '9'.

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 9'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 9 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Note You need to log in before you can comment on or make changes to this bug.