blob: 3cf6be357e5aae827a4b6a81d60370db7b0038f1 [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;
74allow surfaceflinger window_service:service_manager find;
75
76# allow self to set SCHED_FIFO
77allow surfaceflinger self:capability sys_nice;
78allow surfaceflinger proc_meminfo:file r_file_perms;
79r_dir_file(surfaceflinger, cgroup)
80r_dir_file(surfaceflinger, sysfs_type)
81r_dir_file(surfaceflinger, system_file)
82allow surfaceflinger tmpfs:dir r_dir_perms;
83allow surfaceflinger system_server:fd use;
84allow surfaceflinger ion_device:chr_file r_file_perms;
85
86###
87### Neverallow rules
88###
89### surfaceflinger should NEVER do any of this
90
91# Do not allow accessing SDcard files as unsafe ejection could
92# cause the kernel to kill the process.
93neverallow surfaceflinger sdcard_type:file rw_file_perms;