blob: 13b7b9f90365b327c85d4925a80010f60d6de641 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute dumpstate coredomain;
Primiano Tucci2f998092021-01-07 17:12:21 +00002type dumpstate_tmpfs, file_type;
Alex Klyubinf5446eb2017-03-23 14:27:32 -07003
dcashmancc39f632016-07-22 13:13:11 -07004init_daemon_domain(dumpstate)
5
6# Execute and transition to the vdc domain
7domain_auto_trans(dumpstate, vdc_exec, vdc)
dcashman2e00e632016-10-12 14:58:09 -07008
Chris Morin1d88bf52022-02-12 13:52:39 -08009# Create tmpfs files for using memfd descriptors to get output from child
10# processes.
11tmpfs_domain(dumpstate)
12
Joel Scherpelz5e901bb2017-04-25 11:53:51 +090013# Acquire advisory lock on /system/etc/xtables.lock from ip[6]tables
14allow dumpstate system_file:file lock;
15
ynwange68d2d22016-07-01 12:18:54 -070016allow dumpstate storaged_exec:file rx_file_perms;
17
Hongming Jin58f83412021-02-09 12:03:40 -080018# /data/misc/a11ytrace for accessibility traces
19userdebug_or_eng(`
20 allow dumpstate accessibility_trace_data_file:dir r_dir_perms;
21 allow dumpstate accessibility_trace_data_file:file r_file_perms;
22')
23
Vishnu Nair2d6942d2017-11-17 08:23:32 -080024# /data/misc/wmtrace for wm traces
25userdebug_or_eng(`
26 allow dumpstate wm_trace_data_file:dir r_dir_perms;
27 allow dumpstate wm_trace_data_file:file r_file_perms;
28')
29
Jeff Sharkeyef5e5c82023-02-06 14:25:48 -070030# /data/system/dropbox for dropbox entries
31userdebug_or_eng(`
32 allow dumpstate dropbox_data_file:dir r_dir_perms;
33 allow dumpstate dropbox_data_file:file r_file_perms;
34')
35
Ted Bauereaeb65f2024-07-01 19:36:21 +000036r_dir_file(dumpstate, aconfig_storage_metadata_file);
37r_dir_file(dumpstate, aconfig_test_mission_files);
38
Mike Made3a3e42018-12-03 10:35:40 -080039# Allow dumpstate to make binder calls to incidentd
40binder_call(dumpstate, incidentd)
41
ThiƩbaud Weksteen3b1c8432023-01-04 12:57:11 +110042# Kill incident in case of a timeout
43allow dumpstate incident:process { signal sigkill };
44
ynwange68d2d22016-07-01 12:18:54 -070045# Allow dumpstate to make binder calls to storaged service
46binder_call(dumpstate, storaged)
Keun-young Park43e8fae2017-03-03 13:13:25 -080047
Yao Chenb10ff332018-01-17 16:17:28 -080048# Allow dumpstate to make binder calls to statsd
49binder_call(dumpstate, statsd)
50
Joel Galenson7c275a62018-11-13 12:35:17 -080051# Allow dumpstate to talk to gpuservice over binder
52binder_call(dumpstate, gpuservice);
53
Joel Galenson657470a2018-12-05 11:01:04 -080054# Allow dumpstate to talk to idmap over binder
55binder_call(dumpstate, idmap);
56
Alex Hong906c7242020-11-10 14:12:38 +080057# Allow dumpstate to talk to profcollectd over binder
58userdebug_or_eng(`
59 binder_call(dumpstate, profcollectd)
60')
61
Changyeon Jo152a2f12023-09-26 18:44:35 +000062# Allow dumpstate to talk to automotive_display_service over binder
63binder_call(dumpstate, automotive_display_service)
64
Jan Sebechlebskyde644172023-11-30 10:57:16 +010065# Allow dumpstate to talk to virtual_camera service over binder
66binder_call(dumpstate, virtual_camera)
67
Kangping Donge1ee7682023-12-01 13:02:38 +080068# Allow dumpstate to talk to ot_daemon service over binder
69binder_call(dumpstate, ot_daemon)
70
Keun-young Park43e8fae2017-03-03 13:13:25 -080071# Collect metrics on boot time created by init
72get_prop(dumpstate, boottime_prop)
Andreas Gampe7468db62018-01-24 17:56:25 -080073
Steven Moreland9f41fc02024-02-16 22:38:26 +000074get_prop(dumpstate, misctrl_prop)
75
Andreas Gampe7468db62018-01-24 17:56:25 -080076# Signal native processes to dump their stack.
77allow dumpstate {
Chong Zhang81f5b9f2020-10-15 12:38:30 -070078 mediatranscoding
Andreas Gampe7468db62018-01-24 17:56:25 -080079 statsd
Chalard Jeana4c9f7b2019-04-05 17:33:56 +090080 netd
Jan Sebechlebskyde644172023-11-30 10:57:16 +010081 virtual_camera
Kangping Donge1ee7682023-12-01 13:02:38 +080082 ot_daemon
Andreas Gampe7468db62018-01-24 17:56:25 -080083}:process signal;
Joel Galenson03ff9f92018-02-14 14:32:38 -080084
David Drysdalee1075f72023-03-17 12:21:32 +000085# Only allow dumpstate to dump Keystore on debuggable builds.
Eric Biggersf9519a62021-05-04 20:59:32 -070086userdebug_or_eng(`
87 allow dumpstate keystore:process signal;
88')
David Drysdalee1075f72023-03-17 12:21:32 +000089dontaudit dumpstate keystore:process { signal };
Eric Biggersf9519a62021-05-04 20:59:32 -070090
Joel Galenson03ff9f92018-02-14 14:32:38 -080091# For collecting bugreports.
Hridya Valsaraju23f9f512021-05-04 22:01:51 -070092no_debugfs_restriction(`
93 allow dumpstate debugfs_wakeup_sources:file r_file_perms;
94')
95
Joel Galenson03ff9f92018-02-14 14:32:38 -080096allow dumpstate dev_type:blk_file getattr;
97allow dumpstate webview_zygote:process signal;
Hridya Valsaraju6217b662021-01-10 21:09:37 -080098allow dumpstate sysfs_dmabuf_stats:file r_file_perms;
Joel Galenson03ff9f92018-02-14 14:32:38 -080099dontaudit dumpstate update_engine:binder call;
Alistair Delva2bbf1ce2020-12-02 16:04:12 -0800100
101# Read files in /proc
102allow dumpstate {
Steven Moreland832dc372023-12-21 01:22:13 +0000103 config_gz
Alistair Delva2bbf1ce2020-12-02 16:04:12 -0800104 proc_net_tcp_udp
105 proc_pid_max
106}:file r_file_perms;
Joe Onorato5536a082018-12-07 17:20:14 -0800107
108# For comminucating with the system process to do confirmation ui.
109binder_call(dumpstate, incidentcompanion_service)
David Andersondc2a7872019-09-06 14:52:21 -0700110
Inseob Kim55e5c9b2020-03-04 17:20:35 +0900111# Set properties.
112# dumpstate_prop is used to share state with the Shell app.
113set_prop(dumpstate, dumpstate_prop)
114set_prop(dumpstate, exported_dumpstate_prop)
115
116# dumpstate_options_prop is used to pass extra command-line args.
117set_prop(dumpstate, dumpstate_options_prop)
118
119# Allow dumpstate to kill vendor dumpstate service by init
120set_prop(dumpstate, ctl_dumpstate_prop)
121
David Andersondc2a7872019-09-06 14:52:21 -0700122# For dumping dynamic partition information.
123set_prop(dumpstate, lpdumpd_prop)
124binder_call(dumpstate, lpdumpd)
David Anderson14eaa6c2019-09-09 17:52:06 -0700125
Enrico Granata645c3902021-10-01 13:11:36 -0600126# For dumping hypervisor information.
127get_prop(dumpstate, hypervisor_prop)
128
David Anderson14eaa6c2019-09-09 17:52:06 -0700129# For dumping device-mapper and snapshot information.
130allow dumpstate gsid_exec:file rx_file_perms;
131set_prop(dumpstate, ctl_gsid_prop)
132binder_call(dumpstate, gsid)
Yifan Hong91709db2019-10-29 14:12:16 -0700133
Devin Moore96456572024-01-31 17:48:43 +0000134#Allow access to /dev/binderfs/binder_logs
Steven Moreland248f0e02024-05-17 22:30:40 +0000135userdebug_or_eng(`
136 allow dumpstate binderfs_logs_transactions:file r_file_perms;
137')
Steven Moreland496f08d2024-06-03 19:30:04 +0000138dontaudit dumpstate binderfs_logs_transactions:file r_file_perms;
Steven Moreland9956cdf2024-05-23 19:38:57 +0000139allow dumpstate binderfs_logs_transaction_history:file r_file_perms;
Devin Moore96456572024-01-31 17:48:43 +0000140
Yifan Hong91709db2019-10-29 14:12:16 -0700141r_dir_file(dumpstate, ota_metadata_file)
Primiano Tucci2f998092021-01-07 17:12:21 +0000142
143# For starting (and killing) perfetto --save-for-bugreport. If a labelled trace
144# is being recorded, the command above will serialize it into
145# /data/misc/perfetto-traces/bugreport/*.pftrace .
146domain_auto_trans(dumpstate, perfetto_exec, perfetto)
147allow dumpstate perfetto:process signal;
148allow dumpstate perfetto_traces_data_file:dir { search };
149allow dumpstate perfetto_traces_bugreport_data_file:dir rw_dir_perms;
150allow dumpstate perfetto_traces_bugreport_data_file:file { r_file_perms unlink };
151
152# When exec-ing /system/bin/perfetto, dumpstates redirects stdio to /dev/null
153# (which is labelled as dumpstate_tmpfs) to avoid leaking a FD to the bugreport
154# zip file. These rules are to allow perfetto.te to inherit dumpstate's
155# /dev/null.
156allow perfetto dumpstate_tmpfs:file rw_file_perms;
157allow perfetto dumpstate:fd use;
Ramji Jiyani3b59a532022-03-11 21:21:57 +0000158
159# system_dlkm_file for /system_dlkm partition
160allow dumpstate system_dlkm_file:dir getattr;
MƄrten Kongstad098e9092022-09-20 14:19:30 +0200161
162# Allow dumpstate to execute derive_sdk in its own domain
163domain_auto_trans(dumpstate, derive_sdk_exec, derive_sdk)
Inseob Kim75806ef2024-03-27 17:18:41 +0900164
165net_domain(dumpstate)
166binder_use(dumpstate)
167wakelock_use(dumpstate)
168
169# Allow setting process priority, protect from OOM killer, and dropping
170# privileges by switching UID / GID
171allow dumpstate self:global_capability_class_set { setuid setgid sys_resource };
172
173# Allow dumpstate to scan through /proc/pid for all processes
174r_dir_file(dumpstate, domain)
175
176allow dumpstate self:global_capability_class_set {
177 # Send signals to processes
178 kill
179 # Run iptables
180 net_raw
181 net_admin
182};
183
184# Allow executing files on system, such as:
185# /system/bin/toolbox
186# /system/bin/logcat
187# /system/bin/dumpsys
188allow dumpstate system_file:file execute_no_trans;
189not_full_treble(`allow dumpstate vendor_file:file execute_no_trans;')
190allow dumpstate toolbox_exec:file rx_file_perms;
191
192# hidl searches for files in /system/lib(64)/hw/
193allow dumpstate system_file:dir r_dir_perms;
194
195# Create and write into /data/anr/
196allow dumpstate self:global_capability_class_set { dac_override dac_read_search chown fowner fsetid };
197allow dumpstate anr_data_file:dir rw_dir_perms;
198allow dumpstate anr_data_file:file create_file_perms;
199
200# Allow reading /data/system/uiderrors.txt
201# TODO: scope this down.
202allow dumpstate system_data_file:file r_file_perms;
203
204# Allow dumpstate to append into apps' private files.
ThiƩbaud Weksteen76f72612024-05-15 10:43:45 +1000205allow dumpstate app_data_file_type:file append;
Inseob Kim75806ef2024-03-27 17:18:41 +0900206
207# Read dmesg
208allow dumpstate self:global_capability2_class_set syslog;
209allow dumpstate kernel:system syslog_read;
210
211# Read /sys/fs/pstore/console-ramoops
212allow dumpstate pstorefs:dir r_dir_perms;
213allow dumpstate pstorefs:file r_file_perms;
214
215# Get process attributes
216allow dumpstate domain:process getattr;
217
218# Signal java processes to dump their stack
219allow dumpstate { appdomain system_server zygote app_zygote }:process signal;
220
221# Signal native processes to dump their stack.
222allow dumpstate {
223 # This list comes from native_processes_to_dump in dumputils/dump_utils.c
224 audioserver
225 cameraserver
226 drmserver
227 inputflinger
228 mediadrmserver
229 mediaextractor
230 mediametrics
231 mediaserver
232 mediaswcodec
233 sdcardd
234 surfaceflinger
235 vold
236
237 # This list comes from hal_interfaces_to_dump in dumputils/dump_utils.c
238 evsmanagerd
239 hal_audio_server
240 hal_audiocontrol_server
241 hal_bluetooth_server
242 hal_broadcastradio_server
243 hal_camera_server
244 hal_codec2_server
245 hal_drm_server
246 hal_evs_server
247 hal_face_server
248 hal_fingerprint_server
249 hal_graphics_allocator_server
250 hal_graphics_composer_server
251 hal_health_server
252 hal_input_processor_server
253 hal_neuralnetworks_server
254 hal_omx_server
255 hal_power_server
256 hal_power_stats_server
257 hal_sensors_server
258 hal_thermal_server
259 hal_vehicle_server
260 hal_vr_server
261 system_suspend_server
262}:process signal;
263
ThiƩbaud Weksteen4164a5a2024-06-13 12:04:53 +1000264# On userdebug, dumpstate may fork and execute a command as su. Make sure the
265# timeout logic is allowed to terminate the child process if necessary.
266userdebug_or_eng(`
267 allow dumpstate su:process { signal sigkill };
268')
269
Inseob Kim75806ef2024-03-27 17:18:41 +0900270# Connect to tombstoned to intercept dumps.
271unix_socket_connect(dumpstate, tombstoned_intercept, tombstoned)
272
273# Access to /sys
274allow dumpstate sysfs_type:dir r_dir_perms;
275
276allow dumpstate {
277 sysfs_devices_block
278 sysfs_dm
279 sysfs_loop
280 sysfs_usb
281 sysfs_zram
282}:file r_file_perms;
283
284# Ignore other file access under /sys.
285dontaudit dumpstate sysfs:file r_file_perms;
286
287# Other random bits of data we want to collect
288no_debugfs_restriction(`
289 allow dumpstate debugfs:file r_file_perms;
290 auditallow dumpstate debugfs:file r_file_perms;
291
292 allow dumpstate debugfs_mmc:file r_file_perms;
293')
294
295# df for
296allow dumpstate {
297 block_device
298 cache_file
299 metadata_file
300 rootfs
301 selinuxfs
302 storage_file
303 tmpfs
304}:dir { search getattr };
305allow dumpstate fuse_device:chr_file getattr;
306allow dumpstate { dm_device cache_block_device }:blk_file getattr;
307allow dumpstate { cache_file rootfs }:lnk_file { getattr read };
308
309# Read /dev/cpuctl and /dev/cpuset
310r_dir_file(dumpstate, cgroup)
311r_dir_file(dumpstate, cgroup_v2)
312
313# Allow dumpstate to make binder calls to any binder service
314binder_call(dumpstate, binderservicedomain)
315binder_call(dumpstate, { appdomain artd netd wificond })
316
317# Allow dumpstate to call dump() on specific hals.
318dump_hal(hal_audio)
319dump_hal(hal_audiocontrol)
320dump_hal(hal_authgraph)
321dump_hal(hal_authsecret)
322dump_hal(hal_bluetooth)
323dump_hal(hal_broadcastradio)
324dump_hal(hal_camera)
325dump_hal(hal_codec2)
326dump_hal(hal_contexthub)
327dump_hal(hal_drm)
328dump_hal(hal_dumpstate)
329dump_hal(hal_evs)
330dump_hal(hal_face)
331dump_hal(hal_fingerprint)
332dump_hal(hal_gnss)
333dump_hal(hal_graphics_allocator)
334dump_hal(hal_graphics_composer)
335dump_hal(hal_health)
336dump_hal(hal_identity)
337dump_hal(hal_input_processor)
338dump_hal(hal_keymint)
339dump_hal(hal_light)
340dump_hal(hal_memtrack)
341dump_hal(hal_neuralnetworks)
342dump_hal(hal_nfc)
343dump_hal(hal_oemlock)
344dump_hal(hal_power)
345dump_hal(hal_power_stats)
346dump_hal(hal_rebootescrow)
347dump_hal(hal_secretkeeper)
348dump_hal(hal_sensors)
349dump_hal(hal_thermal)
350dump_hal(hal_vehicle)
351dump_hal(hal_weaver)
352dump_hal(hal_wifi)
353
354# Vibrate the device after we are done collecting the bugreport
355hal_client_domain(dumpstate, hal_vibrator)
356
357# Reading /proc/PID/maps of other processes
358allow dumpstate self:global_capability_class_set sys_ptrace;
359
360# Allow the bugreport service to create a file in
361# /data/data/com.android.shell/files/bugreports/bugreport
362allow dumpstate shell_data_file:dir create_dir_perms;
363allow dumpstate shell_data_file:file create_file_perms;
364
365# Run a shell.
366allow dumpstate shell_exec:file rx_file_perms;
367
368# For running am and similar framework commands.
369# Run /system/bin/app_process.
370allow dumpstate zygote_exec:file rx_file_perms;
371
372# For Bluetooth
373allow dumpstate bluetooth_data_file:dir search;
374allow dumpstate bluetooth_logs_data_file:dir r_dir_perms;
375allow dumpstate bluetooth_logs_data_file:file r_file_perms;
376
377# For Nfc
378allow dumpstate nfc_logs_data_file:dir r_dir_perms;
379allow dumpstate nfc_logs_data_file:file r_file_perms;
380
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +0000381# For uwb
382allow dumpstate apex_module_data_file:dir search;
383allow dumpstate apex_system_server_data_file:dir search;
384allow dumpstate apex_uwb_data_file:dir r_dir_perms;
385allow dumpstate apex_uwb_data_file:file r_file_perms;
386
Inseob Kim75806ef2024-03-27 17:18:41 +0900387# Dumpstate calls screencap, which grabs a screenshot. Needs gpu access
388allow dumpstate gpu_device:chr_file rw_file_perms;
389allow dumpstate gpu_device:dir r_dir_perms;
390
391# logd access
392read_logd(dumpstate)
393control_logd(dumpstate)
394read_runtime_log_tags(dumpstate)
395
396# Read files in /proc
397allow dumpstate {
398 proc_bootconfig
399 proc_buddyinfo
400 proc_cmdline
401 proc_meminfo
402 proc_modules
403 proc_net_type
404 proc_pipe_conf
405 proc_pagetypeinfo
Bart Searsdbca6252024-08-04 23:06:24 +0000406 proc_qtaguid_ctrl
407 proc_qtaguid_stat
Inseob Kim75806ef2024-03-27 17:18:41 +0900408 proc_slabinfo
409 proc_version
410 proc_vmallocinfo
411 proc_vmstat
412}:file r_file_perms;
413
414# Read network state info files.
415allow dumpstate net_data_file:dir search;
416allow dumpstate net_data_file:file r_file_perms;
417
418# List sockets via ss.
Bo Huaa577262024-12-01 21:14:32 +0000419allow dumpstate self:netlink_tcpdiag_socket { create_socket_perms_no_ioctl nlmsg_read };
Inseob Kim75806ef2024-03-27 17:18:41 +0900420
421# Access /data/tombstones.
422allow dumpstate tombstone_data_file:dir r_dir_perms;
423allow dumpstate tombstone_data_file:file r_file_perms;
424
425# Access /cache/recovery
426allow dumpstate cache_recovery_file:dir r_dir_perms;
427allow dumpstate cache_recovery_file:file r_file_perms;
428
429# Access /data/misc/recovery
430allow dumpstate recovery_data_file:dir r_dir_perms;
431allow dumpstate recovery_data_file:file r_file_perms;
432
433# Access /data/misc/update_engine & /data/misc/update_engine_log
434allow dumpstate { update_engine_data_file update_engine_log_data_file }:dir r_dir_perms;
435allow dumpstate { update_engine_data_file update_engine_log_data_file }:file r_file_perms;
436# Access /data/misc/snapuserd_log
437allow dumpstate snapuserd_log_data_file:dir r_dir_perms;
438allow dumpstate snapuserd_log_data_file:file r_file_perms;
439
440# Access /data/misc/profiles/{cur,ref}/
441userdebug_or_eng(`
442 allow dumpstate { user_profile_root_file user_profile_data_file}:dir r_dir_perms;
443 allow dumpstate user_profile_data_file:file r_file_perms;
444')
445
446# Access /data/misc/logd
447allow dumpstate misc_logd_file:dir r_dir_perms;
448allow dumpstate misc_logd_file:file r_file_perms;
449
450# Access /data/misc/prereboot
451allow dumpstate prereboot_data_file:dir r_dir_perms;
452allow dumpstate prereboot_data_file:file r_file_perms;
453
454allow dumpstate app_fuse_file:dir r_dir_perms;
455allow dumpstate overlayfs_file:dir r_dir_perms;
456
457allow dumpstate {
458 service_manager_type
459 -apex_service
460 -dumpstate_service
461 -gatekeeper_service
462 -hal_service_type
463 -virtual_touchpad_service
464 -vold_service
465 -default_android_service
466}:service_manager find;
467# suppress denials for services dumpstate should not be accessing.
468dontaudit dumpstate {
469 apex_service
470 dumpstate_service
471 gatekeeper_service
472 hal_service_type
473 virtual_touchpad_service
474 vold_service
475}:service_manager find;
476
477# Most of these are neverallowed.
478dontaudit dumpstate hwservice_manager_type:hwservice_manager find;
479
480allow dumpstate servicemanager:service_manager list;
481allow dumpstate hwservicemanager:hwservice_manager list;
482
483allow dumpstate devpts:chr_file rw_file_perms;
484
485# Read any system properties
486get_prop(dumpstate, property_type)
487
488# Access to /data/media.
489# This should be removed if sdcardfs is modified to alter the secontext for its
490# accesses to the underlying FS.
491allow dumpstate media_rw_data_file:dir getattr;
492allow dumpstate proc_interrupts:file r_file_perms;
493allow dumpstate proc_zoneinfo:file r_file_perms;
494
495# Create a service for talking back to system_server
496add_service(dumpstate, dumpstate_service)
497
498# use /dev/ion for screen capture
499allow dumpstate ion_device:chr_file r_file_perms;
500
501# Allow dumpstate to run top
502allow dumpstate proc_stat:file r_file_perms;
503
504allow dumpstate proc_pressure_cpu:file r_file_perms;
505allow dumpstate proc_pressure_mem:file r_file_perms;
506allow dumpstate proc_pressure_io:file r_file_perms;
507
508# Allow dumpstate to run ps
509allow dumpstate proc_pid_max:file r_file_perms;
510
511# Allow dumpstate to talk to installd over binder
512binder_call(dumpstate, installd);
513
514# Allow dumpstate to run ip xfrm policy
Bo Hub55aaff2024-12-01 21:14:32 +0000515allow dumpstate self:netlink_xfrm_socket { create_socket_perms_no_ioctl nlmsg_read };
Inseob Kim75806ef2024-03-27 17:18:41 +0900516
517# Allow dumpstate to run iotop
518allow dumpstate self:netlink_socket create_socket_perms_no_ioctl;
519# newer kernels (e.g. 4.4) have a new class for sockets
520allow dumpstate self:netlink_generic_socket create_socket_perms_no_ioctl;
521
522# Allow dumpstate to run ss
523allow dumpstate { domain pdx_channel_socket_type pdx_endpoint_socket_type }:socket_class_set getattr;
524
525# Allow dumpstate to read linkerconfig directory
526allow dumpstate linkerconfig_file:dir { read open };
527
528# For when dumpstate runs df
529dontaudit dumpstate {
530 mnt_vendor_file
531 mirror_data_file
532 mnt_user_file
533 mnt_product_file
534}:dir search;
535dontaudit dumpstate {
536 apex_mnt_dir
537 linkerconfig_file
538 mirror_data_file
539 mnt_user_file
Inseob Kim0b9625d2024-07-31 17:42:23 +0900540 vm_data_file
Inseob Kim75806ef2024-03-27 17:18:41 +0900541}:dir getattr;
542
543# Allow dumpstate to talk to bufferhubd over binder
544binder_call(dumpstate, bufferhubd);
545
546# Allow dumpstate to talk to mediaswcodec over binder
547binder_call(dumpstate, mediaswcodec);
548
549#Access /data/misc/snapshotctl_log
550allow dumpstate snapshotctl_log_data_file:dir r_dir_perms;
551allow dumpstate snapshotctl_log_data_file:file r_file_perms;
552
553#Allow access to /dev/binderfs/binder_logs
554allow dumpstate binderfs_logs:dir r_dir_perms;
555allow dumpstate binderfs_logs:file r_file_perms;
556allow dumpstate binderfs_logs_proc:file r_file_perms;
557allow dumpstate binderfs_logs_stats:file r_file_perms;
558
559use_apex_info(dumpstate)
560
561# Allow reading files under /data/system/shutdown-checkpoints/
562allow dumpstate shutdown_checkpoints_system_data_file:dir r_dir_perms;
563allow dumpstate shutdown_checkpoints_system_data_file:file r_file_perms;
564
565###
566### neverallow rules
567###
568
569# dumpstate has capability sys_ptrace, but should only use that capability for
570# accessing sensitive /proc/PID files, never for using ptrace attach.
571neverallow dumpstate *:process ptrace;
572
573# only system_server, dumpstate, traceur_app and shell can find the dumpstate service
574neverallow {
575 domain
576 -system_server
577 -shell
578 -traceur_app
579 -dumpstate
580} dumpstate_service:service_manager find;
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +0000581
582# only dumpstate, system_server and related others to access apex_uwb_data_file
583neverallow {
584 domain
585 -dumpstate
586 -system_server
587 -apexd
588 -init
589 -vold_prepare_subdirs
590} apex_uwb_data_file:dir no_rw_file_perms;
591neverallow {
592 domain
593 -dumpstate
594 -system_server
595 -apexd
596 -init
597 -vold_prepare_subdirs
598} apex_uwb_data_file:file no_rw_file_perms;