Bug 728816

Summary: SELinux is preventing /bin/bash from 'getattr' accesses on the blk_file /dev/sdc.
Product: [Fedora] Fedora Reporter: bobt <bobt>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, lohithvnm, mgrepl, nomnex, pavel.srb
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:13a58bb5e0593cd144d420e188637eea38d7d9fe77c911e4ccb585c98d43da31
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-08 06:17:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description bobt 2011-08-07 23:31:35 UTC
SELinux is preventing /bin/bash from 'getattr' accesses on the blk_file /dev/sdc.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that bash should be allowed getattr access on the sdc blk_file 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                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:fixed_disk_device_t:s0
Target Objects                /dev/sdc [ blk_file ]
Source                        sh
Source Path                   /bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.10-4.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40-4.fc15.i686 #1 SMP
                              Fri Jul 29 18:54:39 UTC 2011 i686 i686
Alert Count                   2
First Seen                    Sun 07 Aug 2011 06:36:16 PM EDT
Last Seen                     Sun 07 Aug 2011 06:36:16 PM EDT
Local ID                      2b8e77bb-d4e8-4946-aa7b-31152b3adb59

Raw Audit Messages
type=AVC msg=audit(1312756576.85:150): avc:  denied  { getattr } for  pid=6826 comm="sh" path="/dev/sdc" dev=devtmpfs ino=392790 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file


type=SYSCALL msg=audit(1312756576.85:150): arch=i386 syscall=stat64 success=no exit=EACCES a0=9f53ae8 a1=bfdc1228 a2=4a3eaff4 a3=9f53aee items=0 ppid=819 pid=6826 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sh exe=/bin/bash subj=system_u:system_r:abrt_t:s0-s0:c0.c1023 key=(null)

Hash: sh,abrt_t,fixed_disk_device_t,blk_file,getattr

audit2allow

#============= abrt_t ==============
#!!!! This avc is allowed in the current policy

allow abrt_t fixed_disk_device_t:blk_file getattr;

audit2allow -R

#============= abrt_t ==============
#!!!! This avc is allowed in the current policy

allow abrt_t fixed_disk_device_t:blk_file getattr;

Comment 1 bobt 2011-08-07 23:35:08 UTC
put a video dvd in 2nd dvd drive.

Comment 2 Miroslav Grepl 2011-08-08 06:17:19 UTC
Please update to the latest selinux-policy

yum update selinux-policy --enablerepo=updates-testing

Comment 3 nomnex 2011-08-24 22:36:34 UTC
I got this error just after changing ownership of a newly formatted USB HD with Gnome-disk utility (on F-15 LXDE) which returned this error on formatting: (ext4)

Error creating partition

An error occured while performng an operation on "80 GB Hard Disk" (SAMSUNG MP0804H): The operation failed

Detail:


Error creating file system: helper exited with exit code 1: cannot create directory /var/run/udisks/job-mkfs-ZxDO88: No such file or directory

I believe both error are connected. This is for information, looking at the bug status.

Comment 4 Daniel Walsh 2011-08-26 21:48:55 UTC
nomnex please open a separate bug.

Comment 5 nomnex 2011-08-29 08:00:30 UTC
Hello Daniel,

re-reading my comment, that's not very clear.

1. a bug about the issue is already opened
2. comment #3 was just to relate the detail of the operation I was performing when the SElinux bug report appeared.

The SELinux msg was: SELinux is preventing /bin/bash from 'getattr' accesses on the blk_file /dev/sdc. Since I was formatting a USB HD at that time (which returned a formatting error), I assumed both operation were connected?

I had never encountered this message before. selinux-policy-3.9.16-35.fc15

Comment 6 Daniel Walsh 2011-08-30 20:07:03 UTC
Yes, I believe you are seeing a different bug.  What AVC messages are you seeing?

Comment 7 nomnex 2011-09-01 04:17:27 UTC
http://danwalsh.livejournal.com/4780.html. It this the AVC (below) or do I need past the /var/log/audit/audit.log file?

SELinux is preventing /bin/bash from getattr access on the blk_file /dev/sdc.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that bash should be allowed getattr access on the sdc blk_file 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                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:fixed_disk_device_t:s0
Target Objects                /dev/sdc [ blk_file ]
Source                        sh
Source Path                   /bin/bash
Port                          <Unknown>
Host                          nh28d
Source RPM Packages           bash-4.2.10-4.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-35.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     nh28d
Platform                      Linux nh28d 2.6.40.3-0.fc15.i686 #1 SMP Tue Aug 16
                              04:24:09 UTC 2011 i686 i686
Alert Count                   2
First Seen                    Thu 25 Aug 2011 07:24:52 AM JST
Last Seen                     Thu 25 Aug 2011 07:24:52 AM JST
Local ID                      a848c68e-6e99-404e-938d-5472812ab357

Raw Audit Messages
type=AVC msg=audit(1314224692.542:69): avc:  denied  { getattr } for  pid=2451 comm="sh" path="/dev/sdc" dev=devtmpfs ino=7156 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file


type=SYSCALL msg=audit(1314224692.542:69): arch=i386 syscall=stat64 success=no exit=EACCES a0=9042ac8 a1=bfe47d68 a2=4725eff4 a3=9042ace items=0 ppid=728 pid=2451 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sh exe=/bin/bash subj=system_u:system_r:abrt_t:s0-s0:c0.c1023 key=(null)

Hash: sh,abrt_t,fixed_disk_device_t,blk_file,getattr

audit2allow

#============= abrt_t ==============
allow abrt_t fixed_disk_device_t:blk_file getattr;

audit2allow -R

#============= abrt_t ==============
allow abrt_t fixed_disk_device_t:blk_file getattr;

http://danwalsh.livejournal.com/4780.html (more reading...)