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