Skip to content
Snippets Groups Projects
Commit 45c41f35 authored by Max's avatar Max Committed by android-build-merger
Browse files

/dev/port does not seem to be used, adding in rules to confirm.

am: c27c23fb

Change-Id: I28f0ec1eac5fa78ca1268089954c190c0e38b188
parents 2643c6f7 c27c23fb
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
/dev/mtp_usb u:object_r:mtp_device:s0 /dev/mtp_usb u:object_r:mtp_device:s0
/dev/pmsg0 u:object_r:pmsg_device:s0 /dev/pmsg0 u:object_r:pmsg_device:s0
/dev/pn544 u:object_r:nfc_device:s0 /dev/pn544 u:object_r:nfc_device:s0
/dev/port u:object_r:port_device:s0
/dev/ppp u:object_r:ppp_device:s0 /dev/ppp u:object_r:ppp_device:s0
/dev/ptmx u:object_r:ptmx_device:s0 /dev/ptmx u:object_r:ptmx_device:s0
/dev/pvrsrvkm u:object_r:gpu_device:s0 /dev/pvrsrvkm u:object_r:gpu_device:s0
......
...@@ -27,6 +27,7 @@ type graphics_device, dev_type; ...@@ -27,6 +27,7 @@ type graphics_device, dev_type;
type hw_random_device, dev_type; type hw_random_device, dev_type;
type input_device, dev_type; type input_device, dev_type;
type kmem_device, dev_type; type kmem_device, dev_type;
type port_device, dev_type;
type log_device, dev_type, mlstrustedobject; type log_device, dev_type, mlstrustedobject;
type mtd_device, dev_type; type mtd_device, dev_type;
type mtp_device, dev_type, mlstrustedobject; type mtp_device, dev_type, mlstrustedobject;
......
...@@ -268,13 +268,18 @@ neverallow * { file_type -exec_type -postinstall_file }:file entrypoint; ...@@ -268,13 +268,18 @@ neverallow * { file_type -exec_type -postinstall_file }:file entrypoint;
# Ensure that nothing in userspace can access /dev/mem or /dev/kmem # Ensure that nothing in userspace can access /dev/mem or /dev/kmem
neverallow { neverallow {
domain domain
-init
-kernel
-shell # For CTS and is restricted to getattr in shell.te -shell # For CTS and is restricted to getattr in shell.te
-ueventd # Further restricted in ueventd.te -ueventd # Further restricted in ueventd.te
} kmem_device:chr_file *; } kmem_device:chr_file *;
neverallow * kmem_device:chr_file ~{ create relabelto unlink setattr getattr }; neverallow * kmem_device:chr_file ~{ create relabelto unlink setattr getattr };
#Ensure that nothing in userspace can access /dev/port
neverallow {
domain
-shell # Shell user should not have any abilities outside of getattr
-ueventd
} port_device:chr_file *;
neverallow * port_device:chr_file ~{ create relabelto unlink setattr getattr };
# Only init should be able to configure kernel usermodehelpers or # Only init should be able to configure kernel usermodehelpers or
# security-sensitive proc settings. # security-sensitive proc settings.
neverallow { domain -init } usermodehelper:file { append write }; neverallow { domain -init } usermodehelper:file { append write };
......
...@@ -184,7 +184,7 @@ allow init { fs_type -contextmount_type -sdcard_type -rootfs }:file { open read ...@@ -184,7 +184,7 @@ allow init { fs_type -contextmount_type -sdcard_type -rootfs }:file { open read
allow init { fs_type -contextmount_type -sdcard_type -rootfs }:dir { open read setattr search }; allow init { fs_type -contextmount_type -sdcard_type -rootfs }:dir { open read setattr search };
# chown/chmod on devices. # chown/chmod on devices.
allow init { dev_type -kmem_device }:chr_file { read open setattr }; allow init { dev_type -kmem_device -port_device }:chr_file { read open setattr };
# Unlabeled file access for upgrades from 4.2. # Unlabeled file access for upgrades from 4.2.
allow init unlabeled:dir { create_dir_perms relabelfrom }; allow init unlabeled:dir { create_dir_perms relabelfrom };
......
...@@ -178,6 +178,7 @@ neverallow shell { ...@@ -178,6 +178,7 @@ neverallow shell {
fuse_device fuse_device
hw_random_device hw_random_device
kmem_device kmem_device
port_device
}:chr_file ~getattr; }:chr_file ~getattr;
# Limit shell to only getattr on blk devices for host side tests. # Limit shell to only getattr on blk devices for host side tests.
......
...@@ -46,5 +46,5 @@ neverallow ueventd property_type:property_service set; ...@@ -46,5 +46,5 @@ neverallow ueventd property_type:property_service set;
# Restrict ueventd access on block devices to maintenence operations. # Restrict ueventd access on block devices to maintenence operations.
neverallow ueventd dev_type:blk_file ~{ getattr relabelfrom relabelto create setattr unlink }; neverallow ueventd dev_type:blk_file ~{ getattr relabelfrom relabelto create setattr unlink };
# Only relabelto as we would never want to relabelfrom kmem_device # Only relabelto as we would never want to relabelfrom kmem_device or port_device
neverallow ueventd kmem_device:chr_file ~{ getattr create setattr unlink relabelto }; neverallow ueventd { kmem_device port_device }:chr_file ~{ getattr create setattr unlink relabelto };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment