blob: 5f7549d1634633a7aac4eaf604582411dc9421eb [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)
12binder_call(surfaceflinger, hal_graphics_allocator)
13binder_call(surfaceflinger, hal_graphics_composer)
14binder_call(surfaceflinger, hal_configstore)
15
16# Perform Binder IPC.
17binder_use(surfaceflinger)
18binder_call(surfaceflinger, binderservicedomain)
19binder_call(surfaceflinger, appdomain)
20binder_call(surfaceflinger, bootanim)
21binder_service(surfaceflinger)
22
23# Binder IPC to bu, presently runs in adbd domain.
24binder_call(surfaceflinger, adbd)
25
26# Read /proc/pid files for Binder clients.
27r_dir_file(surfaceflinger, binderservicedomain)
28r_dir_file(surfaceflinger, appdomain)
29
30# Access the GPU.
31allow surfaceflinger gpu_device:chr_file rw_file_perms;
32
33# Access /dev/graphics/fb0.
34allow surfaceflinger graphics_device:dir search;
35allow surfaceflinger graphics_device:chr_file rw_file_perms;
36
37# Access /dev/video1.
38allow surfaceflinger video_device:dir r_dir_perms;
39allow surfaceflinger video_device:chr_file rw_file_perms;
40
41# Create and use netlink kobject uevent sockets.
42allow surfaceflinger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
43
44# Set properties.
45set_prop(surfaceflinger, system_prop)
46set_prop(surfaceflinger, ctl_bootanim_prop)
47
48# Use open files supplied by an app.
49allow surfaceflinger appdomain:fd use;
50allow surfaceflinger app_data_file:file { read write };
51
52# Allow a dumpstate triggered screenshot
53binder_call(surfaceflinger, dumpstate)
54binder_call(surfaceflinger, shell)
55r_dir_file(surfaceflinger, dumpstate)
56
57# Needed on some devices for playing DRM protected content,
58# but seems expected and appropriate for all devices.
59allow surfaceflinger tee:unix_stream_socket connectto;
60allow surfaceflinger tee_device:chr_file rw_file_perms;
61
62
63# media.player service
64add_service(surfaceflinger, gpu_service)
65
66# do not use add_service() as hal_graphics_composer_default may be the
67# provider as well
68#add_service(surfaceflinger, surfaceflinger_service)
69allow surfaceflinger surfaceflinger_service:service_manager { add find };
70
71allow surfaceflinger mediaserver_service:service_manager find;
72allow surfaceflinger permission_service:service_manager find;
73allow surfaceflinger power_service:service_manager find;
Jeff Vander Stoep8bf3b7a2017-02-10 13:33:56 -080074allow surfaceflinger vr_manager_service:service_manager find;
Alex Klyubin5d30beb2017-02-07 10:05:07 -080075allow surfaceflinger window_service:service_manager find;
76
Jeff Vander Stoep8bf3b7a2017-02-10 13:33:56 -080077
Alex Klyubin5d30beb2017-02-07 10:05:07 -080078# allow self to set SCHED_FIFO
79allow surfaceflinger self:capability sys_nice;
80allow surfaceflinger proc_meminfo:file r_file_perms;
81r_dir_file(surfaceflinger, cgroup)
82r_dir_file(surfaceflinger, sysfs_type)
83r_dir_file(surfaceflinger, system_file)
84allow surfaceflinger tmpfs:dir r_dir_perms;
85allow surfaceflinger system_server:fd use;
86allow surfaceflinger ion_device:chr_file r_file_perms;
87
Nick Bray084faf02017-02-09 15:15:11 -080088# pdx IPC
89pdx_server(surfaceflinger)
90
91use_pdx(surfaceflinger, bufferhubd)
92use_pdx(surfaceflinger, performanced)
93use_pdx(surfaceflinger, sensord)
94
Alex Klyubin5d30beb2017-02-07 10:05:07 -080095###
96### Neverallow rules
97###
98### surfaceflinger should NEVER do any of this
99
100# Do not allow accessing SDcard files as unsafe ejection could
101# cause the kernel to kill the process.
102neverallow surfaceflinger sdcard_type:file rw_file_perms;