Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 535988 - net-analyzer/tcpdump wants access to debugfs_t
Summary: net-analyzer/tcpdump wants access to debugfs_t
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard: sec-policy r7
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-08 07:27 UTC by Eric Gisse
Modified: 2015-08-04 18:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Gisse 2015-01-08 07:27:56 UTC
While chasing some other interesting things, I needed to use tcpdump.

This resulted in a minor avc denial:

Jan  8 01:11:06 testbed kernel: [26965.229255] audit: type=1400 audit(1420701066.037:1257): avc:  denied  { search } for  pid=5953 comm="tcpdump" name="/" dev="debugfs" ino=1 ipaddr=173.173.113.156 scontext=root:sysadm_r:netutils_t tcontext=system_u:object_r:debugfs_t tclass=dir permissive=1

Thankfully there's an interface that covers this:

kernel_search_debugfs()

This looks relatively benign and easy to fix/dontaudit.

I'm somewhat inclined in the direction of dontaudit / upstream reporting, because at first blush I would say tcpdump has no business looking through /sys/kernel/debug (the only thing I have as debugfs_t).

Further, this only shows up if I am nonspecific as to the interface I am sniffing which makes me think there's some sort of function internal to tcpdump that does a 'search' for interfaces it can use which passes over that debugfs location.
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2015-02-16 16:08:09 UTC
Is there a particular tcpdump command that you were doing? I tried here but a "standard" tcpdump -i <iface> does not give that denial here.
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2015-06-07 09:02:38 UTC
I missed your "if I am nonspecific" paragraph.

Another denial I get then is:

time->Sun Jun  7 10:52:50 2015
type=AVC msg=audit(1433667170.527:83): avc:  denied  { read } for  pid=17708 comm="tcpdump" name="usbmon4" dev="devtmpfs" ino=163 scontext=staff_u:sysadm_r:netutils_t:s0 tcontext=system_u:object_r:usbmon_device_t:s0 tclass=chr_file permissive=0

I'm going to dontaudit both of these for now
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2015-06-09 10:43:52 UTC
Another set of permissions coming up (now on unstable) due to capabilities being used:

22: kernel_request_load_module(netutils_t) # request nfnetlink-subsys-3 (queue)
23: allow netutils_t self:process getcap; # check capabilities
24: allow netutils_t self:capability setpcap; # set capability
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2015-06-09 10:52:47 UTC
Committed to our repo, will be part of r7
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2015-07-03 16:25:30 UTC
r7 is now ~arch
Comment 6 Jason Zaman gentoo-dev 2015-08-04 18:20:35 UTC
r7 is stable