Skip to content
Snippets Groups Projects
Commit 5f154404 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

Ensure that service_manager adds / finds make sense.

Add a neverallow rule asserting that services registered or queried
through servicemanager must have the attribute service_manager_type
or vndservice_manager_type. Attempting to add or query a service which
does not have one of those attributes is malformed policy.

See
https://android-review.googlesource.com/c/platform/system/sepolicy/+/826500/7/private/system_server.te#696
as an example where this occurred.

Test: compiles
Change-Id: I339bde04b80819b07832d96797fd7f477a4b676a
parent 3361ec43
No related branches found
No related tags found
No related merge requests found
...@@ -180,3 +180,12 @@ type wifiaware_service, app_api_service, system_server_service, service_manager_ ...@@ -180,3 +180,12 @@ type wifiaware_service, app_api_service, system_server_service, service_manager_
type window_service, system_api_service, system_server_service, service_manager_type; type window_service, system_api_service, system_server_service, service_manager_type;
type inputflinger_service, system_api_service, system_server_service, service_manager_type; type inputflinger_service, system_api_service, system_server_service, service_manager_type;
type wpantund_service, system_api_service, service_manager_type; type wpantund_service, system_api_service, service_manager_type;
###
### Neverallow rules
###
# servicemanager handles registering or looking up named services.
# It does not make sense to register or lookup something which is not a service.
# Trigger a compile error if this occurs.
neverallow domain ~{ service_manager_type vndservice_manager_type }:service_manager { add find };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment