Bug 727937 - SELinux is preventing /usr/bin/python from 'setattr' accesses on the directory /var/lib/mock/fedora-15-x86_64/root/usr/libexec/gcc.
Summary: SELinux is preventing /usr/bin/python from 'setattr' accesses on the director...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a9d0552bcec6e246a0780cc0b27...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-03 17:38 UTC by Adam Williamson
Modified: 2012-02-10 08:51 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-02-10 08:51:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2011-08-03 17:38:30 UTC
abrt version: 2.0.5
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.0.0-3.1.fc16.x86_64
reason:         SELinux is preventing /usr/bin/python from 'setattr' accesses on the directory /var/lib/mock/fedora-15-x86_64/root/usr/libexec/gcc.
time:           Wed Aug  3 10:37:16 2011

description:
:SELinux is preventing /usr/bin/python from 'setattr' accesses on the directory /var/lib/mock/fedora-15-x86_64/root/usr/libexec/gcc.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that python should be allowed setattr access on the gcc directory 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 yum /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:system_r:mock_t:s0
:Target Context                system_u:object_r:bin_t:s0
:Target Objects                /var/lib/mock/fedora-15-x86_64/root/usr/libexec/gc
:                              c [ dir ]
:Source                        yum
:Source Path                   /usr/bin/python
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.2-4.fc16
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-13.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.0.0-3.1.fc16.x86_64 #1
:                              SMP Tue Aug 2 12:32:36 PDT 2011 x86_64 x86_64
:Alert Count                   1
:First Seen                    Wed 03 Aug 2011 10:36:10 AM PDT
:Last Seen                     Wed 03 Aug 2011 10:36:10 AM PDT
:Local ID                      589cacaf-d62d-4029-b4f1-55d46155423e
:
:Raw Audit Messages
:type=AVC msg=audit(1312392970.417:472): avc:  denied  { setattr } for  pid=2536 comm="yum" name="gcc" dev=dm-1 ino=532763 scontext=unconfined_u:system_r:mock_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1312392970.417:472): arch=x86_64 syscall=chown success=yes exit=0 a0=1c5fc90 a1=0 a2=0 a3=1b items=0 ppid=2454 pid=2536 auid=501 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm=yum exe=/usr/bin/python subj=unconfined_u:system_r:mock_t:s0 key=(null)
:
:Hash: yum,mock_t,bin_t,dir,setattr
:
:audit2allow
:
:#============= mock_t ==============
:allow mock_t bin_t:dir setattr;
:
:audit2allow -R
:
:#============= mock_t ==============
:allow mock_t bin_t:dir setattr;
:

Comment 1 Adam Williamson 2011-08-03 17:39:33 UTC
This is just an example alert: I have 102, all related to the same thing - selinux is interfering with mock again. If I try to do a mock rebuild with selinux set to enforcing I get:

[adamw@adam bitlbee (f16 %)]$ mock -r fedora-15-x86_64 --rebuild /home/adamw/build/bitlbee/bitlbee-3.0.3-4.fc16.src.rpm
INFO: mock.py version 1.1.12 starting...
State Changed: init plugins
INFO: selinux disabled
State Changed: start
ERROR: Cannot find/open srpm: /home/adamw/build/bitlbee/bitlbee-3.0.3-4.fc16.src.rpm. Error: Unable to open file

if I set it to permissive I can do the rebuild, and I get a ton of avcs, including this one.

Comment 2 Daniel Walsh 2011-08-03 19:35:09 UTC
If you 

chcon -Rt mock_var_lib_t /var/lib/mock 

Does the problem go away?



Miroslav I think we should just label it.


/var/lib/mock(/.*)?		gen_context(system_u:object_r:mock_var_lib_t,s0)

Comment 3 Adam Williamson 2011-08-03 19:58:38 UTC
Nope.

[root@adam bitlbee (f16 %)]# chcon -Rt mock_var_lib_t /var/lib/mock/
[root@adam bitlbee (f16 %)]# setenforce Enforcing
[root@adam bitlbee (f16 %)]# exit
[adamw@adam bitlbee (f16 %)]$ mock -r fedora-15-x86_64 --rebuild /home/adamw/build/bitlbee/bitlbee-3.0.3-4.fc16.src.rpm
INFO: mock.py version 1.1.12 starting...
State Changed: init plugins
INFO: selinux disabled
State Changed: start
ERROR: Cannot find/open srpm: /home/adamw/build/bitlbee/bitlbee-3.0.3-4.fc16.src.rpm. Error: Unable to open file

Comment 4 Daniel Walsh 2011-08-04 17:54:11 UTC
Well that is a different bug.  For now can you execute.

chcon -t mock_var_lib_t /home/adamw/build/bitlbee/bitlbee-3.0.3-4.fc16.src.rpm

And see if it works.

Miroslav we need to turn the mock_run(unconfined_t) off.

Comment 5 Miroslav Grepl 2011-08-05 07:29:44 UTC
Fixed in selinux-policy-3.9.16-37.fc15.

Btw. for the last issue we have "mock_enable_homedirs" boolean.


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