diff --git a/nfc.te b/nfc.te index fc7e16708a8457bb0ad89a999bec9252c7f454ac..a4383bb4f63638ca3abef18f317cd7d4c71e2bd0 100644 --- a/nfc.te +++ b/nfc.te @@ -4,6 +4,9 @@ app_domain(nfc) net_domain(nfc) binder_service(nfc) +# hwbinder access +hwbinder_use(nfc) + # Set NFC properties set_prop(nfc, nfc_prop) diff --git a/te_macros b/te_macros index cfb9785f91682dff474e2158dab657fc1e77d481..7ed051848fc78ac1ed800b2a78a752552d7bfd01 100644 --- a/te_macros +++ b/te_macros @@ -186,6 +186,20 @@ allow servicemanager $1:process getattr; # all domains in domain.te. ') +##################################### +# hwbinder_use(domain) +# Allow domain to use HwBinder IPC. +define(`hwbinder_use', ` +# Call the hwservicemanager and transfer references to it. +allow $1 hwservicemanager:binder { call transfer }; +# hwservicemanager performs getpidcon on clients. +allow hwservicemanager $1:dir search; +allow hwservicemanager $1:file { read open }; +allow hwservicemanager $1:process getattr; +# rw access to /dev/hwbinder and /dev/ashmem is presently granted to +# all domains in domain.te. +') + ##################################### # binder_call(clientdomain, serverdomain) # Allow clientdomain to perform binder IPC to serverdomain.