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