Strengthen ptrace neverallow rules
Add additional compile time constraints on the ability to ptrace various
sensitive domains.
llkd: remove some domains which llkd should never ptrace, even on
debuggable builds, such as kernel threads and init.
crash_dump neverallows: Remove the ptrace neverallow checks because
it duplicates other neverallow assertions spread throughout the policy.
Test: policy compiles and device boots
Change-Id: Ia4240d1ce7143b983bb048e046bb4729d0af5a6e
diff --git a/private/crash_dump.te b/private/crash_dump.te
index aabff29..831ff04 100644
--- a/private/crash_dump.te
+++ b/private/crash_dump.te
@@ -17,6 +17,13 @@
allow crash_dump { llkd logd }:process { ptrace signal sigchld sigstop sigkill };
')
+###
+### neverallow assertions
+###
+
+# ptrace neverallow assertions are spread throughout the other policy
+# files, so we avoid adding redundant assertions here
+
neverallow crash_dump {
bpfloader
init
@@ -29,6 +36,6 @@
ueventd
vendor_init
vold
-}:process { ptrace signal sigstop sigkill };
+}:process { signal sigstop sigkill };
neverallow crash_dump self:process ptrace;