diff --git a/private/app.te b/private/app.te index 068f09539d42c59c01c373d480b4de27c1679b50..c4147234a6a15f34e7b5837ad57fe02cafc0b9ab 100644 --- a/private/app.te +++ b/private/app.te @@ -402,8 +402,10 @@ neverallow appdomain zygote_socket:sock_file write; # ptrace access to non-app domains. neverallow appdomain { domain -appdomain }:process ptrace; -# Write access to /proc/pid entries for any non-app domain. -neverallow appdomain { domain -appdomain }:file write; +# Read or write access to /proc/pid entries for any non-app domain. +# A different form of hidepid=2 like protections +neverallow appdomain { domain -appdomain }:file no_w_file_perms; +neverallow { appdomain -shell } { domain -appdomain }:file no_rw_file_perms; # signal access to non-app domains. # sigchld allowed for parent death notification. diff --git a/public/te_macros b/public/te_macros index c7802d5a7bb70fef7174f396c68806b23b6505a5..851a567e4871763be230915cce787d2dfd232e2e 100644 --- a/public/te_macros +++ b/public/te_macros @@ -176,6 +176,8 @@ typeattribute $1 appdomain; tmpfs_domain($1) # Map with PROT_EXEC. allow $1 $1_tmpfs:file execute; +neverallow { $1 -shell } { domain -$1 }:file no_rw_file_perms; +neverallow { appdomain -shell -$1 } $1:file no_rw_file_perms; ') #####################################