blob: 3808c838f3169d5a149363e657d1867cc1bc0d63 [file] [log] [blame]
Alex Klyubin5d30beb2017-02-07 10:05:07 -08001# surfaceflinger - display compositor service
2
3type surfaceflinger_exec, exec_type, file_type;
dcashmancc39f632016-07-22 13:13:11 -07004init_daemon_domain(surfaceflinger)
Alex Klyubin5d30beb2017-02-07 10:05:07 -08005
6typeattribute surfaceflinger mlstrustedsubject;
7
8read_runtime_log_tags(surfaceflinger)
9
10# Perform HwBinder IPC.
11hwbinder_use(surfaceflinger)
Alex Klyubin9e6b24c2017-03-16 18:48:40 -070012hal_client_domain(surfaceflinger, hal_graphics_allocator)
Alex Klyubin5d30beb2017-02-07 10:05:07 -080013binder_call(surfaceflinger, hal_graphics_composer)
Alex Klyubin9e6b24c2017-03-16 18:48:40 -070014hal_client_domain(surfaceflinger, hal_graphics_composer)
Alex Klyubin5d30beb2017-02-07 10:05:07 -080015binder_call(surfaceflinger, hal_configstore)
Alex Klyubin9e6b24c2017-03-16 18:48:40 -070016hal_client_domain(surfaceflinger, hal_configstore)
Alex Klyubin5d30beb2017-02-07 10:05:07 -080017
18# Perform Binder IPC.
19binder_use(surfaceflinger)
20binder_call(surfaceflinger, binderservicedomain)
21binder_call(surfaceflinger, appdomain)
22binder_call(surfaceflinger, bootanim)
23binder_service(surfaceflinger)
24
25# Binder IPC to bu, presently runs in adbd domain.
26binder_call(surfaceflinger, adbd)
27
28# Read /proc/pid files for Binder clients.
29r_dir_file(surfaceflinger, binderservicedomain)
30r_dir_file(surfaceflinger, appdomain)
31
32# Access the GPU.
33allow surfaceflinger gpu_device:chr_file rw_file_perms;
34
35# Access /dev/graphics/fb0.
36allow surfaceflinger graphics_device:dir search;
37allow surfaceflinger graphics_device:chr_file rw_file_perms;
38
39# Access /dev/video1.
40allow surfaceflinger video_device:dir r_dir_perms;
41allow surfaceflinger video_device:chr_file rw_file_perms;
42
43# Create and use netlink kobject uevent sockets.
44allow surfaceflinger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
45
46# Set properties.
47set_prop(surfaceflinger, system_prop)
48set_prop(surfaceflinger, ctl_bootanim_prop)
49
50# Use open files supplied by an app.
51allow surfaceflinger appdomain:fd use;
52allow surfaceflinger app_data_file:file { read write };
53
54# Allow a dumpstate triggered screenshot
55binder_call(surfaceflinger, dumpstate)
56binder_call(surfaceflinger, shell)
57r_dir_file(surfaceflinger, dumpstate)
58
59# Needed on some devices for playing DRM protected content,
60# but seems expected and appropriate for all devices.
61allow surfaceflinger tee:unix_stream_socket connectto;
62allow surfaceflinger tee_device:chr_file rw_file_perms;
63
64
65# media.player service
66add_service(surfaceflinger, gpu_service)
67
68# do not use add_service() as hal_graphics_composer_default may be the
69# provider as well
70#add_service(surfaceflinger, surfaceflinger_service)
71allow surfaceflinger surfaceflinger_service:service_manager { add find };
72
73allow surfaceflinger mediaserver_service:service_manager find;
74allow surfaceflinger permission_service:service_manager find;
75allow surfaceflinger power_service:service_manager find;
Jeff Vander Stoep8bf3b7a2017-02-10 13:33:56 -080076allow surfaceflinger vr_manager_service:service_manager find;
Alex Klyubin5d30beb2017-02-07 10:05:07 -080077allow surfaceflinger window_service:service_manager find;
78
Jeff Vander Stoep8bf3b7a2017-02-10 13:33:56 -080079
Alex Klyubin5d30beb2017-02-07 10:05:07 -080080# allow self to set SCHED_FIFO
81allow surfaceflinger self:capability sys_nice;
82allow surfaceflinger proc_meminfo:file r_file_perms;
83r_dir_file(surfaceflinger, cgroup)
84r_dir_file(surfaceflinger, sysfs_type)
85r_dir_file(surfaceflinger, system_file)
86allow surfaceflinger tmpfs:dir r_dir_perms;
87allow surfaceflinger system_server:fd use;
88allow surfaceflinger ion_device:chr_file r_file_perms;
89
Nick Bray084faf02017-02-09 15:15:11 -080090# pdx IPC
91pdx_server(surfaceflinger)
92
93use_pdx(surfaceflinger, bufferhubd)
94use_pdx(surfaceflinger, performanced)
95use_pdx(surfaceflinger, sensord)
96
Alex Klyubin5d30beb2017-02-07 10:05:07 -080097###
98### Neverallow rules
99###
100### surfaceflinger should NEVER do any of this
101
102# Do not allow accessing SDcard files as unsafe ejection could
103# cause the kernel to kill the process.
104neverallow surfaceflinger sdcard_type:file rw_file_perms;