diff --git a/app.te b/app.te index 615b39e2bac37c1d9c6328ab6ce22618a0faf576..3d19da7f088f23d0682988ab778ccec493a41702 100644 --- a/app.te +++ b/app.te @@ -236,7 +236,7 @@ neverallow appdomain socket_device:sock_file write; # Unix domain sockets. neverallow appdomain adbd_socket:sock_file write; neverallow appdomain installd_socket:sock_file write; -neverallow { appdomain -bluetooth -radio -shell -system_app } +neverallow { appdomain -bluetooth -radio -shell -system_app -nfc } property_socket:sock_file write; neverallow { appdomain -radio } rild_socket:sock_file write; neverallow appdomain vold_socket:sock_file write; @@ -338,5 +338,5 @@ neverallow { appdomain -system_app -shell } neverallow appdomain fs_type:filesystem ~getattr; # Ability to set system properties. -neverallow { appdomain -system_app -radio -shell -bluetooth } +neverallow { appdomain -system_app -radio -shell -bluetooth -nfc } property_type:property_service set; diff --git a/nfc.te b/nfc.te index 65aaef76cbca14b6225259991ca27f9dfc1e88d7..407a1c317a0840cae7dc244cfb785cf10557f645 100644 --- a/nfc.te +++ b/nfc.te @@ -4,6 +4,10 @@ app_domain(nfc) net_domain(nfc) binder_service(nfc) +# Set NFC properties +unix_socket_connect(nfc, property, init) +allow nfc nfc_prop:property_service set; + # NFC device access. allow nfc nfc_device:chr_file rw_file_perms; diff --git a/property.te b/property.te index 9d6f10612405b005e6aa04623a0dcd01d64e2f07..cfa3ec9687b2a089492ee7121dc34cc301775291 100644 --- a/property.te +++ b/property.te @@ -22,3 +22,4 @@ type security_prop, property_type; type bluetooth_prop, property_type; type pan_result_prop, property_type; type powerctl_prop, property_type; +type nfc_prop, property_type; diff --git a/property_contexts b/property_contexts index 48f7fae69d0bb00aa1ca3a78abfb16eef59bdc62..f89c43282271bd428151fa48b3a3f63b8afbec10 100644 --- a/property_contexts +++ b/property_contexts @@ -58,3 +58,6 @@ ctl.ril-daemon u:object_r:ctl_rildaemon_prop:s0 ctl.bugreport u:object_r:ctl_bugreport_prop:s0 ctl.dhcpcd_bt-pan u:object_r:ctl_dhcp_pan_prop:s0 ctl. u:object_r:ctl_default_prop:s0 + +# NFC properties +nfc. u:object_r:nfc_prop:s0