Merge "init/ueventd and system_server no longer need access to /dev/hw_random."

This commit is contained in:
Elliott Hughes 2021-02-16 20:08:39 +00:00 committed by Gerrit Code Review
commit adaf4fe7a9
3 changed files with 4 additions and 13 deletions

View file

@ -770,9 +770,6 @@ allow system_server cache_private_backup_file:file create_file_perms;
allow system_server usb_device:chr_file rw_file_perms;
allow system_server usb_device:dir r_dir_perms;
# Read from HW RNG (needed by EntropyMixer).
allow system_server hw_random_device:chr_file r_file_perms;
# Read and delete files under /dev/fscklogs.
r_dir_file(system_server, fscklogs)
allow system_server fscklogs:dir { write remove_name };

View file

@ -403,13 +403,11 @@ neverallow * kernel:security setbool;
# that could be set from init.rc.
neverallow { domain -init } kernel:security setsecparam;
# Only init, ueventd, shell and system_server should be able to access HW RNG
# Only the kernel hwrng thread should be able to read from the HW RNG.
neverallow {
domain
-init
-shell # For CTS and is restricted to getattr in shell.te
-system_server
-ueventd
-shell # For CTS, restricted to just getattr in shell.te
-ueventd # To create the /dev/hw_random file
} hw_random_device:chr_file *;
# b/78174219 b/64114943
neverallow {

View file

@ -309,7 +309,6 @@ allow init {
devpts
dm_device
hwbinder_device
hw_random_device
input_device
kmsg_device
null_device
@ -324,6 +323,7 @@ allow init {
# chown/chmod on devices.
allow init {
dev_type
-hw_random_device
-keychord_device
-port_device
}:chr_file setattr;
@ -533,10 +533,6 @@ allow init kernel:process { getsched setsched };
# system/core/fs_mgr/fs_mgr.c - fs_mgr_swapon_all
allow init swap_block_device:blk_file rw_file_perms;
# Read from /dev/hw_random if present.
# system/core/init/init.c - mix_hwrng_into_linux_rng_action
allow init hw_random_device:chr_file r_file_perms;
# Create and access /dev files without a specific type,
# e.g. /dev/.coldboot_done, /dev/.booting
# TODO: Move these files into their own type unless they are