• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Write to /dev/kmsg
2allow charger_type kmsg_device:chr_file rw_file_perms;
3
4# Read access to pseudo filesystems.
5r_dir_file(charger_type, rootfs)
6r_dir_file(charger_type, cgroup)
7r_dir_file(charger_type, cgroup_v2)
8
9# Allow to read /sys/class/power_supply directory
10allow charger_type sysfs_type:dir r_dir_perms;
11
12allow charger_type self:global_capability_class_set {
13    sys_boot
14    sys_tty_config
15};
16
17wakelock_use(charger_type)
18
19allow charger_type self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
20
21# Read/write to /sys/power/state
22allow charger_type sysfs_power:file rw_file_perms;
23
24r_dir_file(charger_type, sysfs_batteryinfo)
25
26# Read /sys/fs/pstore/console-ramoops
27# Don't worry about overly broad permissions for now, as there's
28# only one file in /sys/fs/pstore
29allow charger_type pstorefs:dir r_dir_perms;
30allow charger_type pstorefs:file r_file_perms;
31
32allow charger_type graphics_device:dir r_dir_perms;
33allow charger_type graphics_device:chr_file rw_file_perms;
34allow charger_type input_device:dir r_dir_perms;
35allow charger_type input_device:chr_file r_file_perms;
36allow charger_type tty_device:chr_file rw_file_perms;
37allow charger_type proc_sysrq:file rw_file_perms;
38