Bug 523271 - setroubleshoot: SELinux is preventing /usr/bin/kdm "execute" access on /sbin/grub.
Summary: setroubleshoot: SELinux is preventing /usr/bin/kdm "execute" access on /sbin/...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: kdebase-workspace
Version: rawhide
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:73767704a83...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-14 17:15 UTC by Peter Trenholme
Modified: 2009-09-16 12:24 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-15 16:17:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Peter Trenholme 2009-09-14 17:15:10 UTC
The following was filed automatically by setroubleshoot:

Summary:

SELinux is preventing /usr/bin/kdm "execute" access on /sbin/grub.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied access requested by kdm. It is not expected that this access is
required by kdm 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:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:bootloader_exec_t:s0
Target Objects                /sbin/grub [ file ]
Source                        kdm
Source Path                   /usr/bin/kdm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           kdm-4.3.1-3.fc12
Target RPM Packages           grub-0.97-59.fc12
Policy RPM                    selinux-policy-3.6.31-3.fc12
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Permissive
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31-2.fc12.x86_64 #1 SMP Thu Sep
                              10 00:25:40 EDT 2009 x86_64 x86_64
Alert Count                   1
First Seen                    Sun 13 Sep 2009 11:56:03 AM PDT
Last Seen                     Sun 13 Sep 2009 11:56:03 AM PDT
Local ID                      b6539807-ab99-4c2d-b396-68ff8af92bd8
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1252868163.210:55): avc:  denied  { execute } for  pid=1507 comm="kdm" name="grub" dev=dm-2 ino=40515 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:bootloader_exec_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1252868163.210:55): arch=c000003e syscall=21 success=yes exit=0 a0=7fff04c32506 a1=1 a2=0 a3=7fff04c31290 items=0 ppid=1 pid=1507 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="kdm" exe="/usr/bin/kdm" subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 key=(null)


audit2allow suggests:

#============= xdm_t ==============
allow xdm_t bootloader_exec_t:file execute;

Comment 1 Peter Trenholme 2009-09-14 17:26:38 UTC
This, and two additional messages are generated, I believe, because KDE/KDM has a feature in the "Reboot" selection when quitting to, after specifying the boot loader, select the OS into which to reboot. Implementation of this feature require that KDE (or KDM) read and parse the boot configuration file and, when a reboot target is selected, that the process modify the boot loader.

If this supposition is correct, the SELinux policy will need to permit (I'd guess) KDM rw access to both the GRUB and LILO boot configuration files.

This may, of course, be an unacceptable security risk, in which case I suppose that the "reboot target selection" feature should be disabled when SELinux in in "Enforcing" mode.

Comment 2 Daniel Walsh 2009-09-14 19:48:15 UTC
Just because an app allows a Dumb idea, and a potential security flaw does not mean that SELinux has to allow it.  If you want to allow the login program to manipulate the /etc/grub file, then you need to add custom policy to allow this.  I will not support it.

Comment 3 Peter Trenholme 2009-09-15 15:46:13 UTC
That's what I thought too.

Could/Should this "bug" be moved to the KDM/KDE people? Since (I believe) KDM will access this "feature" whenever a user selects the "Reboot" option in the "Leave" pop-up, you're going to get a lot of "access denied" reports cluttering up your in-box when F12 goes live, and disgruntled people telling everyone the SELinux is not worth the trouble. It should be fairly trivial for them to change the KDE "Leave" pop-up application to disable the "Select reboot target" feature when SELinux is active. (They could even ask the user if they really want to use the feature, and warn them of the consequences of so doing.)

Comment 4 Daniel Walsh 2009-09-15 15:53:38 UTC
I would prefer to remove the feature altogether.

Comment 5 Rex Dieter 2009-09-15 15:57:27 UTC
patches welcome, otherwise users are still welcome to continue to modify/customize kdm to use this feature as well as create custom/local policy to allow it.

Comment 6 Daniel Walsh 2009-09-15 16:12:37 UTC
Hey, I use that line all the time.  :^)

Comment 7 Kevin Kofler 2009-09-15 16:17:12 UTC
We aren't going to remove upstream features. We disable it by default, that's as far as we're willing to go.

Comment 8 Kevin Kofler 2009-09-15 23:31:59 UTC
Oh, and FYI:

> Since (I believe) KDM will access this "feature" whenever a user selects the
> "Reboot" option in the "Leave" pop-up

No, it will not, as the default configuration is "no bootloader" (i.e. no bootloader integration). Only if you enable GRUB integration manually in System Settings, you'll trigger the SELinux denial.

Comment 9 Daniel Walsh 2009-09-16 12:24:49 UTC
Sounds ok to me.  If you Change the default settings of an application sometimes you have to adjust the SELinux, which can be done by creating a selinux module.


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