f4fc922f0b
Currently, /system/bin, /system/xbin, /product/bin, and /vendor/bin are 0755, which allows any process to iterate through those directories and list out the contents. For the vast majority of processes, this is unnecessary. They only need to know whether a particular binary exists or doesn't exist, but they don't need to know the other binaries within those directories. Allowing this is particularly problematic for SELinux. In particular, some third party Android applications try to examine every file in the bin directories, generating SELinux audit noise along the way. This audit noise makes it harder to see real bugs, and falsely implies an architectural dependency between the application and random files in directories like /system/bin. This change removes the ability to list the contents of the various bin directories, preventing random probing by such apps. The ability to execute files, or to probe a specific file by name, remain unchanged. Addresses SELinux denials similar to the following: avc: denied { getattr } for comm="Thread-11" path="/system/bin/atrace" dev="dm-0" ino=189 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:atrace_exec:s0 tclass=file permissive=0 app=uk.co.santander.santanderUK avc: denied { getattr } for comm="Binder:26637_2" path="/system/bin/atrace" dev="dm-0" ino=168 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:atrace_exec:s0 tclass=file permissive=0 app=com.tencent.mm avc: denied { getattr } for comm="Thread-12" path="/system/bin/apexd" dev="dm-0" ino=451 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:apexd_exec:s0 tclass=file permissive=1 app=com.grppl.android.shell.CMBlloydsTSB73 Shell access to these directories continues to be allowed, to allow for host-side CTS tests. Also adjust the indentation of some clang directives, to make the presubmit hooks happy. Test: Device boots and no apparent problems. Change-Id: Ibe75682fac1983d39f3f479a5850ab5a96f6627d |
||
---|---|---|
.. | ||
arch-arm | ||
arch-arm64 | ||
arch-mips | ||
arch-x86 | ||
arch-x86_64 | ||
include | ||
include_vndk/cutils | ||
tests | ||
Android.bp | ||
android_get_control_env.h | ||
android_get_control_file.cpp | ||
android_reboot.cpp | ||
ashmem-dev.cpp | ||
ashmem-host.cpp | ||
canned_fs_config.cpp | ||
config_utils.cpp | ||
fs.cpp | ||
fs_config.cpp | ||
hashmap.cpp | ||
iosched_policy.cpp | ||
klog.cpp | ||
load_file.cpp | ||
MODULE_LICENSE_APACHE2 | ||
multiuser.cpp | ||
native_handle.cpp | ||
NOTICE | ||
OWNERS | ||
partition_utils.cpp | ||
properties.cpp | ||
qtaguid.cpp | ||
record_stream.cpp | ||
sched_policy.cpp | ||
socket_inaddr_any_server_unix.cpp | ||
socket_inaddr_any_server_windows.cpp | ||
socket_local_client_unix.cpp | ||
socket_local_server_unix.cpp | ||
socket_local_unix.h | ||
socket_network_client_unix.cpp | ||
socket_network_client_windows.cpp | ||
sockets.cpp | ||
sockets_unix.cpp | ||
sockets_windows.cpp | ||
str_parms.cpp | ||
strdup8to16.cpp | ||
strdup16to8.cpp | ||
strlcpy.c | ||
threads.cpp | ||
trace-container.cpp | ||
trace-dev.cpp | ||
trace-dev.inc | ||
trace-host.cpp | ||
uevent.cpp |