2016-05-20 04:31:20 +02:00
|
|
|
# wificond
|
|
|
|
type wificond, domain;
|
2018-09-27 19:21:37 +02:00
|
|
|
type wificond_exec, system_file_type, exec_type, file_type;
|
2016-05-20 04:31:20 +02:00
|
|
|
|
2016-06-03 19:08:56 +02:00
|
|
|
binder_use(wificond)
|
|
|
|
binder_call(wificond, system_server)
|
2019-06-10 21:46:09 +02:00
|
|
|
binder_call(wificond, wifi_stack)
|
2016-06-03 19:08:56 +02:00
|
|
|
|
2017-01-19 22:23:52 +01:00
|
|
|
add_service(wificond, wificond_service)
|
2016-06-30 23:23:12 +02:00
|
|
|
|
2018-04-09 05:07:32 +02:00
|
|
|
set_prop(wificond, exported_wifi_prop)
|
2016-06-29 20:28:20 +02:00
|
|
|
set_prop(wificond, wifi_prop)
|
2016-07-22 23:34:26 +02:00
|
|
|
set_prop(wificond, ctl_default_prop)
|
2016-07-01 02:48:12 +02:00
|
|
|
|
|
|
|
# create sockets to set interfaces up and down
|
|
|
|
allow wificond self:udp_socket create_socket_perms;
|
2016-08-23 02:47:13 +02:00
|
|
|
# setting interface state up/down is a privileged ioctl
|
2018-01-23 05:42:12 +01:00
|
|
|
allowxperm wificond self:udp_socket ioctl { SIOCSIFFLAGS SIOCSIFHWADDR };
|
2017-11-09 23:51:26 +01:00
|
|
|
allow wificond self:global_capability_class_set { net_admin net_raw };
|
2016-08-23 02:47:13 +02:00
|
|
|
# allow wificond to speak to nl80211 in the kernel
|
2016-05-17 06:12:17 +02:00
|
|
|
allow wificond self:netlink_socket create_socket_perms_no_ioctl;
|
2016-09-01 02:46:42 +02:00
|
|
|
# newer kernels (e.g. 4.4 but not 4.1) have a new class for sockets
|
2016-05-17 06:12:17 +02:00
|
|
|
allow wificond self:netlink_generic_socket create_socket_perms_no_ioctl;
|
2016-07-01 02:48:12 +02:00
|
|
|
|
Start the process of locking down proc/net
Files in /proc/net leak information. This change is the first step in
determining which files apps may use, whitelisting benign access, and
otherwise removing access while providing safe alternative APIs.
To that end, this change:
* Introduces the proc_net_type attribute which will assigned to any
new SELinux types in /proc/net to avoid removing access to privileged
processes. These processes may be evaluated later, but are lower
priority than apps.
* Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing
use by VPN apps. This may be replaced by an alternative API.
* Audits all other proc/net access for apps.
* Audits proc/net access for other processes which are currently
granted broad read access to /proc/net but should not be including
storaged, zygote, clatd, logd, preopt2cachename and vold.
Bug: 9496886
Bug: 68016944
Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube
navigate maps, send text message, make voice call, make video call.
Verify no avc "granted" messages in the logs.
Test: A few VPN apps including "VPN Monster", "Turbo VPN", and
"Freighter". Verify no logspam with the current setup.
Test: atest CtsNativeNetTestCases
Test: atest netd_integration_test
Test: atest QtaguidPermissionTest
Test: atest FileSystemPermissionTest
Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457
Merged-In: I7e49f796a25cf68bc698c6c9206e24af3ae11457
(cherry picked from commit 087318957f26e921d62f2e234fc14bff3c59030e)
2018-04-10 21:47:48 +02:00
|
|
|
r_dir_file(wificond, proc_net_type)
|
2016-07-21 18:12:28 +02:00
|
|
|
|
2017-04-05 01:52:25 +02:00
|
|
|
# allow wificond to check permission for dumping logs
|
|
|
|
allow wificond permission_service:service_manager find;
|
|
|
|
|
2016-09-07 22:58:04 +02:00
|
|
|
# dumpstate support
|
|
|
|
allow wificond dumpstate:fd use;
|
2016-05-17 06:12:17 +02:00
|
|
|
allow wificond dumpstate:fifo_file write;
|