platform_system_sepolicy/dnsmasq.te
Stephen Smalley 08461cb039 Allow netd-spawned domains to use inherited netd unix_dgram_socket.
Resolves denials such as:
 avc:  denied  { read write } for  pid=4346 comm="hostapd" path="socket:[7874]" dev="sockfs" ino=7874 scontext=u:r:hostapd:s0 tcontext=u:r:netd:s0 tclass=unix_dgram_socket
 avc:  denied  { read write } for  pid=4348 comm="dnsmasq" path="socket:[7874]" dev="sockfs" ino=7874 scontext=u:r:dnsmasq:s0 tcontext=u:r:netd:s0 tclass=unix_dgram_socket

Change-Id: Ie82f39c32c6e04bc9ef1369ca787cf80b3b4141c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-03-18 10:46:48 -04:00

23 lines
871 B
Text

# DNS, DHCP services
type dnsmasq, domain;
type dnsmasq_exec, exec_type, file_type;
net_domain(dnsmasq)
# TODO: Run with dhcp group to avoid need for dac_override.
allow dnsmasq self:capability dac_override;
allow dnsmasq self:capability { net_admin net_raw net_bind_service setgid setuid };
allow dnsmasq dhcp_data_file:dir w_dir_perms;
allow dnsmasq dhcp_data_file:file create_file_perms;
# Inherit and use open files from netd.
allow dnsmasq netd:fd use;
allow dnsmasq netd:fifo_file { read write };
# TODO: Investigate whether these inherited sockets should be closed on exec.
allow dnsmasq netd:netlink_kobject_uevent_socket { read write };
allow dnsmasq netd:netlink_nflog_socket { read write };
allow dnsmasq netd:netlink_route_socket { read write };
allow dnsmasq netd:unix_stream_socket { read write };
allow dnsmasq netd:unix_dgram_socket { read write };