sm6225-common: Set PRODUCT_SET_DEBUGFS_RESTRICTIONS

Starting with Android R launched devices, debugfs cannot be mounted in
production builds. In order to avoid accidental debugfs dependencies
from creeping in during development with userdebug/eng builds, the
build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS can be set by vendors to
enforce additional debugfs restrictions for userdebug/eng builds. The
same flag will be used to enable sepolicy neveallow statements to
prevent new permissions added for debugfs access.

Test: build, boot
Bug: 184381659
Change-Id: I45e6f20c886d467a215c9466f3a09965ff897d7e
This commit is contained in:
Hridya Valsaraju 2023-02-27 09:44:56 +01:00 committed by Michael Bestas
parent 122c791486
commit a108236cca
No known key found for this signature in database
GPG key ID: CC95044519BE6669
2 changed files with 0 additions and 25 deletions

View file

@ -209,12 +209,6 @@ on post-fs-data
chown vendor_pwric vendor_pwric /sys/class/power_supply/wireless/voltage_now
chown vendor_pwric vendor_pwric /sys/class/power_supply/wireless/voltage_max
chmod 0664 /sys/class/power_supply/wireless/voltage_max
chown vendor_pwric vendor_pwric /sys/kernel/debug/pmic-votable/CHG_DISABLE/force_val
chmod 0664 /sys/kernel/debug/pmic-votable/CHG_DISABLE/force_val
chown vendor_pwric vendor_pwric /sys/kernel/debug/pmic-votable/CHG_DISABLE/force_active
chmod 0664 /sys/kernel/debug/pmic-votable/CHG_DISABLE/force_active
chown vendor_pwric vendor_pwric /sys/kernel/debug/regulator/smb5-vconn/enable
chmod 0664 /sys/kernel/debug/regulator/smb5-vconn/enable
chown root vendor_mod /sys/module/qpnp_smbcharger_mmi/parameters/eb_rechrg_start_soc
chown root vendor_mod /sys/module/qpnp_smbcharger_mmi/parameters/eb_rechrg_stop_soc

View file

@ -32,28 +32,14 @@ import /vendor/etc/init/hw/init.target.rc
import /vendor/etc/init/hw/init.qcom.factory.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug
# create symlink for vendor mount points
symlink /vendor/firmware_mnt /firmware
symlink /vendor/bt_firmware /bt_firmware
symlink /vendor/dsp /dsp
# Change ownership of hw_recovery related nodes
chown system graphics /sys/kernel/debug/dri/0/debug/dump
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_reg
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_dbgbus
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_vbif_dbgbus
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_dsi_dbgbus
# Change ownership of sysfs power control node
chown system graphics /sys/class/drm/card0/device/power/control
# Change ownership of sw_sync node
chown system graphics /sys/kernel/debug/sync/sw_sync
chmod 0666 /sys/kernel/debug/sync/sw_sync
#Disable UFS clock scaling
write /sys/bus/platform/devices/${ro.boot.bootdevice}/clkscale_enable 0
@ -75,9 +61,6 @@ on init
chown root system /sys/fs/cgroup/memory/bg/tasks
chmod 0660 /sys/fs/cgroup/memory/bg/tasks
on post-fs
chmod 0755 /sys/kernel/debug/tracing
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
@ -114,8 +97,6 @@ on boot
chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
chown system system /sys/module/msm_core/parameters/polling_interval
chown system system /sys/module/msm_core/parameters/disabled
chown system system /sys/kernel/debug/msm_core/enable
chown system system /sys/kernel/debug/msm_core/ptable
chown system system /sys/kernel/boot_slpi/ssr
chown system system /sys/module/radio_iris_transport/parameters/fmsmd_set
chmod 0660 /sys/module/bluetooth_power/parameters/power