Bug 569572 - SELinux is preventing Samba (/usr/sbin/smbd) "getattr" access to /sys/kernel/debug
Summary: SELinux is preventing Samba (/usr/sbin/smbd) "getattr" access to /sys/kernel/...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-01 18:15 UTC by Dave Jones
Modified: 2015-01-04 22:31 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.6.32-99.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-12 04:24:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Jones 2010-03-01 18:15:05 UTC
Why is samba even looking there ?  I'm not exporting sysfs in my smb.conf

If samba has good reason to be reading this, then this should be reassigned to selinux-policy, but I'd like to understand what's going on here.


node=gelk type=AVC msg=audit(1267467013.472:350): avc:  denied  { getattr } for  pid=25660 comm="smbd" path="/sys/kernel/debug" dev=debugfs ino=1 scontext=unconfined_u:system_r:smbd_t:s0 tcontext=system_u:object_r:debugfs_t:s0 tclass=dir

node=gelk type=SYSCALL msg=audit(1267467013.472:350): arch=c000003e syscall=4 success=yes exit=0 a0=7fff180d3df5 a1=7fff180d41f0 a2=7fff180d41f0 a3=3 items=0 ppid=25609 pid=25660 auid=500 uid=0 gid=0 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=4 comm="smbd" exe="/usr/sbin/smbd" subj=unconfined_u:system_r:smbd_t:s0 key=(null)

Comment 1 Eric Paris 2010-03-01 21:30:04 UTC
In case you care, that is a stat() syscall.

Comment 2 Simo Sorce 2010-03-01 21:51:13 UTC
No idea why it would try to access /sys/kernel/debug, maybe some library is doing it behind our back ? 
What were you doing when that happened ?

Comment 3 Daniel Walsh 2010-03-02 13:38:06 UTC
Any chance abrt is doing something to make applications gather debug info.  (I might be showing my ignorance here...)

Comment 4 Daniel Walsh 2010-03-02 13:47:12 UTC
Very similar to #569723

Comment 5 Jiri Moskovcak 2010-03-02 14:03:28 UTC
(In reply to comment #3)
> Any chance abrt is doing something to make applications gather debug info.  (I
> might be showing my ignorance here...)    

Unlikely, abrt kicks in only of the app crashes and it's not linked with the app, it uses /proc/sys/kernel/core_pattern to detect/save coredumps, so there is no way how abrt could influence compiled app behaviour.

Jirka

Comment 6 Daniel Walsh 2010-03-02 14:23:18 UTC
This access seems to be growing.  So I guess it would be a good idea to know what is causing it.

+kernel_search_debugfs(bluetooth_t)
+kernel_read_debugfs(NetworkManager_t)
+kernel_search_debugfs(rgmanager_t)
 kernel_search_debugfs(iscsid_t)
 kernel_mount_debugfs(insmod_t)
 kernel_read_debugfs(insmod_t)
+kernel_search_debugfs(mount_t)
+kernel_search_debugfs(ifconfig_t)

Could this be something all domains need?

Comment 7 Stephen Smalley 2010-03-02 15:20:57 UTC
I'd dontaudit it rather than allow it unless it is shown to truly be needed.
Can the bug reporter run this on his system:

find /lib64 /usr/lib64 -type f -exec strings -f {} \; | grep /sys/kernel/debug

(replace lib64 with lib if on x86_32 of course).

On my system, I get one hit on libpcap, which appears to be trying to access /sys/kernel/debug/usbmon.  Do all of those programs link against it?

Comment 8 Eric Paris 2010-03-02 15:41:40 UTC
this is a mount point, so it oculd be something which runs all mount points...

Comment 9 Stephen Smalley 2010-03-02 15:49:21 UTC
Ah, good observation.  In which case dontaudit should be sufficient.

Comment 10 Stephen Smalley 2010-03-02 15:53:11 UTC
Looking at samba source code, it runs through the mount table via getmntent() and calls stat() on each mnt_dir in a couple of places.  If it fails, it just skips that mount.

Comment 11 Daniel Walsh 2010-03-02 16:28:12 UTC
Ok I will add

kernel_dontaudit_search_debugfs(domain)

Do stop these from popping up randomly.

Miroslav can you add this to F12.

Comment 12 Miroslav Grepl 2010-03-03 09:32:48 UTC
Fixed in selinux-policy-3.6.32-97.fc12

Comment 13 Fedora Update System 2010-03-05 16:54:15 UTC
selinux-policy-3.6.32-99.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-99.fc12

Comment 14 Fedora Update System 2010-03-09 03:21:20 UTC
selinux-policy-3.6.32-99.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-99.fc12

Comment 15 Fedora Update System 2010-03-12 04:22:46 UTC
selinux-policy-3.6.32-99.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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