diff --git a/app.te b/app.te index 239d0bb83981553d89f536a0cf860aa4c4c78ea3..63ee7aa4c8bef28981c1c228691b4a374dd668c6 100644 --- a/app.te +++ b/app.te @@ -238,7 +238,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; @@ -340,5 +340,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 2b851a276fd1e2865bea86aa9093eead3620d3f8..4113d3172a2855921b97ae7adfe187a446c02d2a 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