diff --git a/private/genfs_contexts b/private/genfs_contexts index bb2fea90b339f8a1609bcfbb3019a32440e6d0a3..f7016851d7183f7cd6c702b5e6c1505ba734c0dc 100644 --- a/private/genfs_contexts +++ b/private/genfs_contexts @@ -29,6 +29,7 @@ genfscon proc /sys/vm/drop_caches u:object_r:proc_drop_caches:s0 genfscon proc /sys/vm/overcommit_memory u:object_r:proc_overcommit_memory:s0 genfscon proc /timer_list u:object_r:proc_timer:s0 genfscon proc /timer_stats u:object_r:proc_timer:s0 +genfscon proc /tty/drivers u:object_r:proc_tty_drivers:s0 genfscon proc /uid_cputime/show_uid_stat u:object_r:proc_uid_cputime_showstat:s0 genfscon proc /uid_cputime/remove_uid_range u:object_r:proc_uid_cputime_removeuid:s0 genfscon proc /zoneinfo u:object_r:proc_zoneinfo:s0 diff --git a/public/file.te b/public/file.te index 66680e67a97e72456d54f51ec2fb4b6a49486a9d..6184eef0c1eae44c936bc5d04d2a658f6a55f3dc 100644 --- a/public/file.te +++ b/public/file.te @@ -20,6 +20,7 @@ type proc_net, fs_type; type proc_stat, fs_type; type proc_sysrq, fs_type; type proc_timer, fs_type; +type proc_tty_drivers, fs_type; type proc_uid_cputime_showstat, fs_type; type proc_uid_cputime_removeuid, fs_type; type proc_zoneinfo, fs_type; diff --git a/public/untrusted_app.te b/public/untrusted_app.te index 48662f3d9bc29850ae40a4d4824e393da8db545f..827334287703517b906c4184764b40c898671990 100644 --- a/public/untrusted_app.te +++ b/public/untrusted_app.te @@ -97,6 +97,12 @@ allow untrusted_app sysfs_hwrandom:file r_file_perms; allow untrusted_app preloads_data_file:dir r_dir_perms; allow untrusted_app preloads_data_file:file r_file_perms; +# Access to /proc/tty/drivers, to allow apps to determine if they +# are running in an emulated environment. +# b/33214085 b/33814662 b/33791054 b/33211769 +# https://github.com/strazzere/anti-emulator/blob/master/AntiEmulator/src/diff/strazzere/anti/emulator/FindEmulator.java +allow untrusted_app proc_tty_drivers:file r_file_perms; + ### ### neverallow rules ###