Description of problem: Trying to build a livecd I got this error. I was launching livecd-creator from a sh script in my home directory, launching it with sudo. It is m understanding that it should work with SE enabled - or at least give a hint and option for making it work. SELinux is preventing /usr/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:livecd_t:s0-s0:c0.c1023 Target Context unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 Target Objects /usr/bin/bash [ process ] Source sh Source Path /usr/bin/bash Port <Unknown> Host (removed) Source RPM Packages bash-4.2.45-1.fc18.x86_64 Target RPM Packages bash-4.2.45-1.fc18.x86_64 Policy RPM selinux-policy-3.11.1-87.fc18.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Permissive Host Name (removed) Platform Linux (removed) 3.8.3-201.fc18.x86_64 #1 SMP Thu Mar 14 21:28:05 UTC 2013 x86_64 x86_64 Alert Count 1 First Seen 2013-04-13 14:31:59 CEST Last Seen 2013-04-13 14:31:59 CEST Local ID 07528517-7bf7-4510-9dbe-4a78e5c7425c Raw Audit Messages type=AVC msg=audit(1365856319.736:1950): avc: denied { transition } for pid=13289 comm="rpm" path="/usr/bin/bash" dev="loop0" ino=136535 scontext=unconfined_u:system_r:livecd_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 tclass=process type=SYSCALL msg=audit(1365856319.736:1950): arch=x86_64 syscall=execve per=8 success=yes exit=0 a0=16dc800 a1=16ed6b0 a2=16e7320 a3=20 items=0 ppid=13288 pid=13289 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=2 tty=pts6 comm=sh exe=/usr/bin/bash subj=unconfined_u:system_r:rpm_script_t:s0-s0:c0.c1023 key=(null) Hash: sh,livecd_t,rpm_script_t,process,transition audit2allow #============= livecd_t ============== allow livecd_t rpm_script_t:process transition; audit2allow -R require { type livecd_t; } #============= livecd_t ============== rpm_transition_script(livecd_t) Additional info: hashmarkername: setroubleshoot kernel: 3.8.3-201.fc18.x86_64 type: libreport
Miroslav do you think this is a bug in livecd tool, since it is not supposed to be doing SELinux stuff within the build. Mads, did the live image build correctly?
Yes, it seems like it did build and work correctly. Hmm ... could it be because I in a %post --nochroot section do a rpm -q ? But I assume read-only operations is ok - everything should be allowed in a %post --nochroot section.
Well a post install would cause a rpm_script_transition, but not sure what you mean by this. Did you install a special rpm? into a livecd?
Yes, the .ks will also do something like %post --nochroot rpm --root $INSTALL_ROOT -i -f --nodeps .../xxx.rpm to install a RPM without installing all dependencies. What I had in mind was another useful use of rpm in %post --nochroot: rpm -q livecd-tools > $INSTALL_ROOT/versions.txt
I guess we should add the transition, since we want the post install scripts to run, but we relabel at the end so it should fix it up. I wish livecd_tools was like mock and did no SELinux actions.
From my point of view: %post sections are custom shell scripts and the user run them as root. Any kind of limitations of what can be done from them will hit some livecd-tool user - you shouldn't try. This error was just the example I hit. I don't think that allowing that transition would make a significant difference. You could perhaps lock ordinary %post sections down so they can't escape from the chroot ... but I don't think it is worth it.
587e992cd2f55fab53425fe6e8dea58a36fc619c fixes this in git.
selinux-policy-3.11.1-91.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-91.fc18
Package selinux-policy-3.11.1-91.fc18: * should fix your issue, * was pushed to the Fedora 18 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.11.1-91.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-6018/selinux-policy-3.11.1-91.fc18 then log in and leave karma (feedback).
selinux-policy-3.11.1-91.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.