Skip to content

Commit

Permalink
sepolicy: cleanup move to minimal sepolicy custom source
Browse files Browse the repository at this point in the history
- cleanup and not required sepolicy causing issues
- Structured the clo way

[Co-author commit included in squash]
- include github.com/ahnet-69/hardware_sony/commit/568a6c97df1b7917c7bf213fea89da9be306b01f

Co-authored-by: adithya2306 <[email protected]>
Signed-off-by: hpnightowl <[email protected]>
  • Loading branch information
hpnightowl and adithya2306 committed Dec 22, 2024
1 parent a3d7e9d commit 2bc2999
Show file tree
Hide file tree
Showing 60 changed files with 75 additions and 328 deletions.
13 changes: 13 additions & 0 deletions P404Sepolicy.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# This policy configuration will be used by all qcom products
# that inherit from 404
#

SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \
device/404/sepolicy/private

SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \
device/404/sepolicy/public

BOARD_VENDOR_SEPOLICY_DIRS += \
device/404/sepolicy/vendor
Empty file removed common/dynamic/file.te
Empty file.
Empty file removed common/dynamic/genfs_contexts
Empty file.
5 changes: 0 additions & 5 deletions common/dynamic/hal_lineage_camera_motor.te

This file was deleted.

8 changes: 0 additions & 8 deletions common/dynamic/hal_lineage_powershare.te

This file was deleted.

2 changes: 0 additions & 2 deletions common/dynamic/hwservice.te

This file was deleted.

2 changes: 0 additions & 2 deletions common/dynamic/hwservice_contexts

This file was deleted.

11 changes: 0 additions & 11 deletions common/private/backuptool.te

This file was deleted.

2 changes: 0 additions & 2 deletions common/private/cameraserver.te

This file was deleted.

2 changes: 0 additions & 2 deletions common/private/file.te

This file was deleted.

13 changes: 0 additions & 13 deletions common/private/file_contexts

This file was deleted.

29 changes: 0 additions & 29 deletions common/private/gallery_app.te

This file was deleted.

1 change: 0 additions & 1 deletion common/private/genfs_contexts

This file was deleted.

5 changes: 0 additions & 5 deletions common/private/platform_app.te

This file was deleted.

1 change: 0 additions & 1 deletion common/private/priv_app.te

This file was deleted.

20 changes: 0 additions & 20 deletions common/private/recovery.te

This file was deleted.

3 changes: 0 additions & 3 deletions common/private/seapp_contexts

This file was deleted.

4 changes: 0 additions & 4 deletions common/private/service.te

This file was deleted.

2 changes: 0 additions & 2 deletions common/private/service_contexts

This file was deleted.

39 changes: 0 additions & 39 deletions common/private/snap_app.te

This file was deleted.

6 changes: 0 additions & 6 deletions common/private/system_server.te

This file was deleted.

26 changes: 0 additions & 26 deletions common/private/updater_app.te

This file was deleted.

3 changes: 0 additions & 3 deletions common/public/attributes

This file was deleted.

1 change: 0 additions & 1 deletion common/public/file.te

This file was deleted.

1 change: 0 additions & 1 deletion common/public/shell.te

This file was deleted.

10 changes: 0 additions & 10 deletions common/public/te_macros

This file was deleted.

29 changes: 0 additions & 29 deletions common/sepolicy.mk

This file was deleted.

4 changes: 0 additions & 4 deletions common/system-only/file_contexts

This file was deleted.

14 changes: 0 additions & 14 deletions common/vendor/file_contexts

This file was deleted.

5 changes: 0 additions & 5 deletions common/vendor/hal_lineage_camera_motor_default.te

This file was deleted.

5 changes: 0 additions & 5 deletions common/vendor/hal_lineage_powershare_default.te

This file was deleted.

8 changes: 0 additions & 8 deletions legacy-common/public/legacy-camera-hal1/mediaserver.te

This file was deleted.

9 changes: 0 additions & 9 deletions legacy-common/sepolicy.mk

This file was deleted.

1 change: 1 addition & 0 deletions private/appdomain.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get_prop(appdomain, pih_disable_prop)
3 changes: 3 additions & 0 deletions private/bootanim.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Allow bootanimation to call mediametrics.
allow bootanim mediametrics_service:service_manager find;
binder_call(bootanim, mediametrics)
8 changes: 8 additions & 0 deletions private/genfs_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dirty writeback tunables
genfscon proc /sys/vm/dirty_background_bytes u:object_r:proc_dirty:s0
#genfscon proc /sys/vm/dirty_background_ratio u:object_r:proc_dirty:s0
genfscon proc /sys/vm/dirty_bytes u:object_r:proc_dirty:s0
genfscon proc /sys/vm/dirty_ratio u:object_r:proc_dirty:s0
#genfscon proc /sys/vm/dirty_expire_centisecs u:object_r:proc_dirty:s0
genfscon proc /sys/vm/dirty_writeback_centisecs u:object_r:proc_dirty:s0
genfscon proc /sys/vm/dirtytime_expire_seconds u:object_r:proc_dirty:s0
1 change: 1 addition & 0 deletions private/platform_app.te
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
binder_use(platform_app)
5 changes: 5 additions & 0 deletions private/property.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PIHooks
system_public_prop(pih_disable_prop)

# Tethering
system_internal_prop(device_config_tethering_prop)
5 changes: 5 additions & 0 deletions private/property_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PIHooks
persist.sys.pihooks.disable. u:object_r:pih_disable_prop:s0

# Tethering
persist.device_config.tethering. u:object_r:device_config_tethering_prop:s0
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions private/shell.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Allow shell to get LMKD's stats
get_prop(shell, system_lmk_prop)

# Allow shell to disable PIHooks
set_prop(shell, pih_disable_prop)
5 changes: 5 additions & 0 deletions private/system_server.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set tethering properties
set_prop(system_server, device_config_tethering_prop)

# CachedAppOptimizer
allow system_server zygote_tmpfs:file rw_file_perms;
6 changes: 1 addition & 5 deletions common/private/update_engine.te → private/update_engine.te
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Allow update_engine to call the callback function provided by updater_app
binder_call(update_engine, updater_app)
binder_call(update_engine, hub_app)

# Read updates from storage data
r_dir_file(update_engine, mnt_user_file)
r_dir_file(update_engine, storage_file)

# Allow mount and unmount of system partition
allow update_engine labeledfs:filesystem { mount unmount };

# Allow transition to backuptool domain
allow update_engine self:process setexec;
domain_trans(update_engine, otapreopt_chroot_exec, backuptool)
2 changes: 2 additions & 0 deletions public/file.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Fastcharge
type sysfs_fastcharge, sysfs_type, fs_type;
17 changes: 17 additions & 0 deletions public/te_macros
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#####################################
# rw_dir_file(domain, type)
# Allow the specified domain to read directories and read/write files
# and symbolic links of the specified type.
define(`rw_dir_file', `
allow $1 $2:dir r_dir_perms;
allow $1 $2:{ file lnk_file } rw_file_perms;
')

#####################################
# create_dir_file(domain, type)
# Allow the specified domain to read directories and create files
# and symbolic links of the specified type.
define(`create_dir_file', `
allow $1 $2:dir r_dir_perms;
allow $1 $2:{ file lnk_file } create_file_perms;
')
1 change: 0 additions & 1 deletion qcom/dynamic/dontaudit.te

This file was deleted.

2 changes: 0 additions & 2 deletions qcom/private/property_contexts

This file was deleted.

Loading

0 comments on commit 2bc2999

Please sign in to comment.