Bug 743504

Summary: SELinux is preventing /bin/bash from using the 'transition' accesses on a process.
Product: [Fedora] Fedora Reporter: T.C. Hollingsworth <tchollingsworth>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, dwmw2, maycon.franca, mgrepl, silentdi
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e7e3f573c763078a0238edeefccaa24faf151ed3c79f36997bf3fcd67ad1269f
Fixed In Version: selinux-policy-3.10.0-51.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-05 01:33:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
YUM transaction that caused AVC denial none

Description T.C. Hollingsworth 2011-10-05 07:13:01 UTC
libreport version: 2.0.6
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-0.rc8.git0.0.fc16.x86_64
reason:         SELinux is preventing /bin/bash from using the 'transition' accesses on a process.
time:           Wed Oct  5 00:12:05 2011

description:
:SELinux is preventing /bin/bash from using the 'transition' accesses on a process.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that bash should be allowed transition access on processes labeled rpm_script_t 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 sh /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:system_r:bootloader_t:s0-s0:c0.c1023
:Target Context                unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023
:Target Objects                /bin/bash [ process ]
:Source                        sh
:Source Path                   /bin/bash
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           bash-4.2.10-4.fc16
:Target RPM Packages           bash-4.2.10-4.fc16
:Policy RPM                    selinux-policy-3.10.0-36.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.1.0-0.rc8.git0.0.fc16.x86_64 #1 SMP Wed Sep 28
:                              01:31:14 UTC 2011 x86_64 x86_64
:Alert Count                   1
:First Seen                    Wed 05 Oct 2011 12:10:15 AM MST
:Last Seen                     Wed 05 Oct 2011 12:10:15 AM MST
:Local ID                      3b3b6c06-8af4-44b9-a3e1-bd1476aa1653
:
:Raw Audit Messages
:type=AVC msg=audit(1317798615.853:129): avc:  denied  { transition } for  pid=15112 comm="rpm" path="/bin/bash" dev=dm-1 ino=261249 scontext=unconfined_u:system_r:bootloader_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 tclass=process
:
:
:type=SYSCALL msg=audit(1317798615.853:129): arch=x86_64 syscall=execve success=yes exit=0 a0=e39fe0 a1=cfe380 a2=7fff99567238 a3=7fff99566930 items=0 ppid=15111 pid=15112 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm=sh exe=/bin/bash subj=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 key=(null)
:
:Hash: sh,bootloader_t,rpm_script_t,process,transition
:
:audit2allow
:
:#============= bootloader_t ==============
:allow bootloader_t rpm_script_t:process transition;
:
:audit2allow -R
:
:#============= bootloader_t ==============
:allow bootloader_t rpm_script_t:process transition;
:

Comment 1 T.C. Hollingsworth 2011-10-05 07:17:21 UTC
Created attachment 526437 [details]
YUM transaction that caused AVC denial

Comment 2 Daniel Walsh 2011-10-07 14:31:20 UTC
This looks like for some reason you logged in as bootloader_t?  Which is very wrong?

id -Z

Comment 3 T.C. Hollingsworth 2011-10-08 08:20:12 UTC
(In reply to comment #2)
> This looks like for some reason you logged in as bootloader_t?  Which is very
> wrong?
> 
> id -Z

# id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

I haven't touched anything SELinux on this machine whatsoever.  That just happened in the middle of the attached RPM transaction.

I thought it might be the kernel update since that's the only thing that should have had anything to do with GRUB, but "yum reinstall kernel" didn't reproduce it.

Comment 4 Miroslav Grepl 2011-10-10 11:31:06 UTC
Are you able to reproduce it?

Comment 5 T.C. Hollingsworth 2011-10-10 12:42:38 UTC
Yes, it happened again yesterday when I got kernel-3.1.0-0.rc9.git0.0.fc16.x86_64.

/var/log/yum.log:
Oct 09 09:46:40 Updated: 1:xscreensaver-base-5.15-2.fc16.x86_64
Oct 09 09:46:53 Updated: abrt-libs-2.0.4.981-3.fc16.x86_64
Oct 09 09:46:56 Updated: libkgeomap-2.2.0-1.fc16.x86_64
Oct 09 09:46:58 Updated: 1:xscreensaver-extras-base-5.15-2.fc16.x86_64
Oct 09 09:46:59 Updated: libkface-2.2.0-1.fc16.x86_64
Oct 09 09:47:13 Updated: digikam-2.2.0-1.fc16.x86_64
Oct 09 09:47:17 Updated: digikam-libs-2.2.0-1.fc16.x86_64
Oct 09 09:47:24 Updated: 1:xscreensaver-extras-5.15-2.fc16.x86_64
Oct 09 09:47:25 Updated: 1:xscreensaver-gl-base-5.15-2.fc16.x86_64
Oct 09 09:47:29 Updated: 1:xscreensaver-gl-extras-5.15-2.fc16.x86_64
Oct 09 09:47:32 Updated: libreport-2.0.6-2.fc16.x86_64
Oct 09 09:47:34 Updated: libreport-python-2.0.6-2.fc16.x86_64
Oct 09 09:47:38 Updated: abrt-2.0.4.981-3.fc16.x86_64
Oct 09 09:47:40 Updated: abrt-retrace-client-2.0.4.981-3.fc16.x86_64
Oct 09 09:47:41 Updated: abrt-addon-python-2.0.4.981-3.fc16.x86_64
Oct 09 09:47:46 Updated: abrt-addon-ccpp-2.0.4.981-3.fc16.x86_64
Oct 09 09:47:47 Updated: libreport-plugin-logger-2.0.6-2.fc16.x86_64
Oct 09 09:47:49 Updated: libreport-gtk-2.0.6-2.fc16.x86_64
Oct 09 09:47:52 Updated: abrt-gui-2.0.4.981-3.fc16.x86_64
Oct 09 09:47:57 Updated: libreport-plugin-bugzilla-2.0.6-2.fc16.x86_64
Oct 09 09:47:59 Updated: libreport-plugin-kerneloops-2.0.6-2.fc16.x86_64
Oct 09 09:48:03 Updated: abrt-addon-kerneloops-2.0.4.981-3.fc16.x86_64
Oct 09 09:48:05 Updated: abrt-addon-vmcore-2.0.4.981-3.fc16.x86_64
Oct 09 09:48:06 Updated: libkvkontakte-2.2.0-1.fc16.x86_64
Oct 09 09:48:07 Updated: kipi-plugins-libs-2.2.0-1.fc16.x86_64
Oct 09 09:48:20 Updated: kipi-plugins-2.2.0-1.fc16.x86_64
Oct 09 09:48:22 Updated: 1:cups-libs-1.5.0-15.fc16.x86_64
Oct 09 09:48:36 Updated: vlc-core-1.1.12-1.fc16.x86_64
Oct 09 09:48:52 Updated: vlc-1.1.12-1.fc16.x86_64
Oct 09 09:48:55 Updated: 1:cups-devel-1.5.0-15.fc16.x86_64
Oct 09 09:48:57 Updated: abrt-desktop-2.0.4.981-3.fc16.x86_64
Oct 09 09:48:59 Updated: libreport-newt-2.0.6-2.fc16.x86_64
Oct 09 09:48:59 Updated: 1:xscreensaver-5.15-2.fc16.x86_64
Oct 09 09:49:09 Updated: kernel-headers-3.1.0-0.rc9.git0.0.fc16.x86_64
Oct 09 09:49:54 Installed: kernel-devel-3.1.0-0.rc9.git0.0.fc16.x86_64
Oct 09 09:49:59 Updated: 1:grub2-1.99-7.fc16.x86_64
Oct 09 09:50:03 Updated: 1:cups-libs-1.5.0-15.fc16.i686
Oct 09 09:50:16 Installed: kernel-3.1.0-0.rc9.git0.0.fc16.x86_64

/var/log/audit/audit.log:
type=AVC msg=audit(1318179123.680:91): avc:  denied  { transition } for  pid=13977 comm="rpm" path="/bin/bash" dev=dm-1 ino=261159 scontext=unconfined_u:system_r:bootloader_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 tclass=process
type=SYSCALL msg=audit(1318179123.680:91): arch=c000003e syscall=59 success=yes exit=0 a0=18acb80 a1=15f7170 a2=7fff03766b68 a3=7fff03766260 items=0 ppid=13976 pid=13977 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm="sh" exe="/bin/bash" subj=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 key=(null)

Comment 6 Daniel Walsh 2011-10-11 17:51:36 UTC
Do you have rpm running in a cron job?  We should probably remove

	bootloader_run(unconfined_t, unconfined_r)

No reason to transition that I can think of.

Comment 7 T.C. Hollingsworth 2011-10-11 21:57:16 UTC
(In reply to comment #6)
> Do you have rpm running in a cron job?  We should probably remove
Nope, just sudo.

Comment 8 Daniel Walsh 2011-10-12 13:17:46 UTC
What sudo command are you running?

Comment 9 T.C. Hollingsworth 2011-10-12 13:30:01 UTC
(In reply to comment #8)
> What sudo command are you running?
Just "yum update".

Comment 10 T.C. Hollingsworth 2011-10-20 15:10:04 UTC
Happened again with today's kernel-3.1.0-0.rc10.git0.1.fc16.x86_64 update.

type=AVC msg=audit(1319122932.807:165): avc:  denied  { transition } for  pid=27996 comm="rpm" path="/bin/bash" dev=dm-1 ino=274487 scontext=unconfined_u:system_r:bootloader_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 tclass=process
type=SYSCALL msg=audit(1319122932.807:165): arch=c000003e syscall=59 success=yes exit=0 a0=14f6f80 a1=15243b0 a2=7fff6a51ece8 a3=33323031632e30 items=0 ppid=27995 pid=27996 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=1 comm="sh" exe="/bin/bash" subj=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 key=(null)

I paid closer attention today and it looks like this happens around %posttrans time.

Comment 11 Daniel Walsh 2011-10-20 20:04:10 UTC
Well we took away the transition from unconfined_t to bootloader_t in selinux-policy-3.10.0-43.fc16

Lets see if this fixes the problem.

Comment 12 Daniel Walsh 2011-10-21 20:50:06 UTC
These are being caused by a bogus label on /sbin/new-kernel-pkg  and /sbin/installkernel

I have removed the labels and they should run as bin_t, this will stop the transition from rpm_t to bootloader_t when the kernel updates.

Fixed in selinux-policy-3.10.0-47.fc16

If you just chcon -t bin_t /sbin/new-kernel-pkg /sbin/installkernel it should fix the problem, until the update arrives.

Comment 13 T.C. Hollingsworth 2011-10-25 05:59:30 UTC
With selinux-policy-3.10.0-48.fc16.noarch from koji I didn't get this AVC updating to kernel-3.1.0-1.fc16.x86_64.  Thanks!

Comment 14 Fedora Update System 2011-10-27 17:04:29 UTC
selinux-policy-3.10.0-51.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-51.fc16

Comment 15 Fedora Update System 2011-10-28 21:31:06 UTC
Package selinux-policy-3.10.0-51.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-51.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15029
then log in and leave karma (feedback).

Comment 16 Fedora Update System 2011-11-05 01:33:06 UTC
selinux-policy-3.10.0-51.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.