Skip to content

Commit

Permalink
clean sepolicy project
Browse files Browse the repository at this point in the history
Tracked-On: OAM-84134
Signed-off-by: Sun, Yi J <[email protected]>
Signed-off-by: sheng wei <[email protected]>
  • Loading branch information
yjsun1 committed Jul 29, 2019
1 parent 451f0c5 commit 8e2c54c
Show file tree
Hide file tree
Showing 522 changed files with 2,652 additions and 1,145 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
typeattribute postinstall system_writes_vendor_properties_violators;
typeattribute postinstall system_executes_vendor_violators;

recovery_only(`
allow postinstall rootfs:file rx_file_perms;
')
Expand Down
1 change: 1 addition & 0 deletions abota/fw_update/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(/system)?/vendor/bin/fw_update.sh u:object_r:fw_update_exec:s0
25 changes: 25 additions & 0 deletions abota/fw_update/fw_update.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# seclabel is specified in init.rc
type fw_update, domain;
type fw_update_exec, exec_type, file_type, vendor_file_type;

recovery_only(`
domain_trans(init, rootfs, fw_update)
allow fw_update rootfs:file rx_file_perms;
')

init_daemon_domain(fw_update)

not_full_treble(`
binder_use(fw_update)
add_service(fw_update, fw_update_service)
')

allow fw_update proc:file r_file_perms;
allow fw_update userdata_block_device:{ lnk_file blk_file } w_file_perms;
allow fw_update vendor_toolbox_exec:file execute_no_trans;
allow fw_update vendor_file:file execute_no_trans;
allow fw_update block_device:dir search;
allow fw_update boot_block_device:blk_file r_file_perms;
allow fw_update tmpfs:dir w_dir_perms;
allow fw_update tmpfs:file w_file_perms;
allow fw_update proc_cmdline:file r_file_perms;
1 change: 1 addition & 0 deletions abota/fw_update/no_vendor_prefix/fw_update.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set_prop(fw_update, ota_prop)
1 change: 1 addition & 0 deletions abota/fw_update/service.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type fw_update_service, service_manager_type;
1 change: 1 addition & 0 deletions abota/fw_update/service_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fw_update u:object_r:fw_update_service:s0
1 change: 1 addition & 0 deletions abota/fw_update/vendor_prefix/fw_update.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set_prop(fw_update, vendor_ota_prop)
File renamed without changes.
1 change: 0 additions & 1 deletion boot-arch/abl/init.te → abota/generic/init.te
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
allow init system_file:system module_load;
allow init tmpfs:file r_file_perms;
allow init { boot_block_device vendor_block_device }:lnk_file relabelto;
4 changes: 4 additions & 0 deletions abota/generic/no_vendor_prefix/postinstall.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
typeattribute postinstall system_writes_vendor_properties_violators;
typeattribute postinstall system_executes_vendor_violators;
set_prop(postinstall, ota_prop)

1 change: 1 addition & 0 deletions abota/generic/no_vendor_prefix/property.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type ota_prop, property_type;
2 changes: 2 additions & 0 deletions abota/generic/no_vendor_prefix/property_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ota.update.abl u:object_r:ota_prop:s0
ota.update.sbl u:object_r:ota_prop:s0
1 change: 1 addition & 0 deletions abota/generic/no_vendor_prefix/vendor_init.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set_prop(vendor_init, ota_prop)
4 changes: 4 additions & 0 deletions abota/generic/postinstall.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
recovery_only(`
allow postinstall rootfs:file rx_file_perms;
')

Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
allow update_engine vendor_block_device:blk_file rw_file_perms;
allow update_engine product_block_device:blk_file rw_file_perms;
allow update_engine odm_block_device:blk_file rw_file_perms;
allow update_engine acpi_block_device:blk_file rw_file_perms;
allow update_engine acpio_block_device:blk_file rw_file_perms;
allow update_engine tmpfs:dir r_dir_perms;
allow update_engine tmpfs:file r_file_perms;
allow update_engine tmpfs:lnk_file r_file_perms;
allow update_engine vendor_shell_exec:file rx_file_perms;

allow update_engine platform_app:binder call;
allow update_engine vfat:dir search;
allow update_engine vfat:file r_file_perms;
allow update_engine sdcardfs:dir search;
allow update_engine sdcardfs:file r_file_perms;
allow update_engine mnt_media_rw_file:file r_file_perms;
allow update_engine mnt_media_rw_file:dir r_dir_perms;
allow update_engine storage_file:file r_file_perms;
allow update_engine storage_file:dir r_dir_perms;
File renamed without changes.
3 changes: 3 additions & 0 deletions abota/generic/vendor_prefix/postinstall.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typeattribute postinstall system_writes_vendor_properties_violators;
typeattribute postinstall system_executes_vendor_violators;
set_prop(postinstall, vendor_ota_prop)
1 change: 1 addition & 0 deletions abota/generic/vendor_prefix/property.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type vendor_ota_prop, property_type;
1 change: 1 addition & 0 deletions abota/generic/vendor_prefix/property_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor.ota.update.fw u:object_r:vendor_ota_prop:s0
1 change: 1 addition & 0 deletions abota/generic/vendor_prefix/vendor_init.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set_prop(vendor_init, vendor_ota_prop)
File renamed without changes.
20 changes: 20 additions & 0 deletions abota/xbl/drmrpc.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Abl_user_cmd service, which is set the drmrpc service property,
# would capsule the target slot info message and write it into
# /dev/mei interface to notice ABL to update itself.
#
# There are two types of abl_user_cmd service, the one is under the
# vendor partition in normal boot mode, and the another is under the
# ramdisk in the recovery mode.

type drmrpc, domain;

not_recovery_only(`
type drmrpc_exec, exec_type, file_type, vendor_file_type;
init_daemon_domain(drmrpc)
')

recovery_only(`
typeattribute drmrpc coredomain;
domain_trans(init, rootfs, drmrpc)
')
allow drmrpc tee_device:chr_file rw_file_perms;
2 changes: 2 additions & 0 deletions abota/xbl/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/bin/abl-user-cmd_vendor u:object_r:drmrpc_exec:s0
/vendor/bin/sbl-user-cmd_vendor u:object_r:drmrpc_exec:s0
1 change: 1 addition & 0 deletions abota/xbl/init.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow init block_device:lnk_file relabelfrom;
26 changes: 0 additions & 26 deletions audio/project-celadon/audioserver.te

This file was deleted.

1 change: 0 additions & 1 deletion audio/project-celadon/file_contexts

This file was deleted.

37 changes: 0 additions & 37 deletions audio/project-celadon/hal_audio_default.te

This file was deleted.

7 changes: 0 additions & 7 deletions audio/project-celadon/netd.te

This file was deleted.

1 change: 0 additions & 1 deletion audio/project-celadon/property.te

This file was deleted.

2 changes: 0 additions & 2 deletions audio/project-celadon/property_contexts

This file was deleted.

6 changes: 0 additions & 6 deletions audio/project-celadon/system_server.te

This file was deleted.

1 change: 0 additions & 1 deletion audio/project-celadon/violators_blacklist.te

This file was deleted.

1 change: 1 addition & 0 deletions autodetect/false/init.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow init self:capability sys_module;
2 changes: 2 additions & 0 deletions autodetect/true/adbd.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allow adbd hal_socket:sock_file write;
allow adbd hal:unix_stream_socket connectto;
1 change: 1 addition & 0 deletions autodetect/true/appdomain.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unix_socket_connect(appdomain, hal, hal)
6 changes: 6 additions & 0 deletions autodetect/true/bluetooth.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
allow bluetooth hal_socket:sock_file write;
allow bluetooth hal:fd use;
allow bluetooth hal:unix_stream_socket { connectto read write };
allow bluetooth rfkill:fd use;
allow bluetooth self:netlink_socket create_socket_perms;

6 changes: 6 additions & 0 deletions autodetect/true/bootanim.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# bootanim
#

# hal access
unix_socket_connect(bootanim, hal, hal)
1 change: 1 addition & 0 deletions autodetect/true/cameraserver.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unix_socket_connect(cameraserver, hal, hal)
1 change: 1 addition & 0 deletions autodetect/true/device.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type hal_device, dev_type;
1 change: 1 addition & 0 deletions autodetect/true/drmserver.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unix_socket_connect(drmserver, hal, hal)
7 changes: 7 additions & 0 deletions autodetect/true/file.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# HAL
# Now that MLS is enabled on plat_app, we need to make the hal
# socket an mlstrustedsubject.
type hal_socket, file_type, mlstrustedobject;

# Hal mounts a lot of filesystems, label the locations specifically
type hal_mnt_pnt, file_type;
28 changes: 28 additions & 0 deletions autodetect/true/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Bluetooth
/dev/ttyBT[0-9] u:object_r:hci_attach_dev:s0

#HAL
/dev/socket/halbindings u:object_r:hal_socket:s0

/dev/hald.ready u:object_r:hal_device:s0

/system/bin/hald u:object_r:hal_exec:s0
/system/bin/hald_media_hook u:object_r:hal_exec:s0
/system/bin/halctl u:object_r:hal_exec:s0

/system/rt/hal_mnt_pnt(/.*)? u:object_r:hal_mnt_pnt:s0
# hal mounts filesystems at:
# /system/etc/permissions
# /system/etc/atomisp
# /system/etc/modprobe.d
/system/etc/permissions(/.*)? u:object_r:hal_mnt_pnt:s0
/system/etc/atomisp(/.*)? u:object_r:hal_mnt_pnt:s0
/system/etc/modprobe.d(/.*)? u:object_r:hal_mnt_pnt:s0
# dm device mounted here
/system/rt/gfx u:object_r:hal_mnt_pnt:s0
/system/rt/hal_fuse u:object_r:hal_mnt_pnt:s0
/system/rt/media u:object_r:hal_mnt_pnt:s0
/system/rt/wifi u:object_r:hal_mnt_pnt:s0

#rfkill
(/system)?/vendor/bin/rfkillp u:object_r:rfkill_exec:s0
1 change: 1 addition & 0 deletions autodetect/true/gatekeeperd.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unix_socket_connect(gatekeeperd, hal, hal)
Loading

1 comment on commit 8e2c54c

@tpalli
Copy link

@tpalli tpalli commented on 8e2c54c Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this commit broke iris driver and some parts of the vulkan driver support. Could we have the removed ioctl's back? Why did you remove the gpu_device:chr_file ioctl's?

Please sign in to comment.