2012-01-04 18:33:27 +01:00
|
|
|
# surfaceflinger - display compositor service
|
|
|
|
type surfaceflinger, domain;
|
|
|
|
type surfaceflinger_exec, exec_type, file_type;
|
|
|
|
|
|
|
|
init_daemon_domain(surfaceflinger)
|
2013-10-29 19:42:40 +01:00
|
|
|
typeattribute surfaceflinger mlstrustedsubject;
|
2012-01-04 18:33:27 +01:00
|
|
|
|
|
|
|
# Talk to init over the property socket.
|
|
|
|
unix_socket_connect(surfaceflinger, property, init)
|
2013-10-29 19:42:40 +01:00
|
|
|
|
|
|
|
# Perform Binder IPC.
|
|
|
|
binder_use(surfaceflinger)
|
2014-03-05 16:17:16 +01:00
|
|
|
binder_call(surfaceflinger, binderservicedomain)
|
|
|
|
binder_call(surfaceflinger, appdomain)
|
2014-04-17 01:31:23 +02:00
|
|
|
binder_call(surfaceflinger, bootanim)
|
2013-10-29 19:42:40 +01:00
|
|
|
binder_service(surfaceflinger)
|
|
|
|
|
2014-03-05 16:17:16 +01:00
|
|
|
# Binder IPC to bu, presently runs in adbd domain.
|
|
|
|
binder_call(surfaceflinger, adbd)
|
|
|
|
|
|
|
|
# Read /proc/pid files for Binder clients.
|
|
|
|
r_dir_file(surfaceflinger, binderservicedomain)
|
|
|
|
r_dir_file(surfaceflinger, appdomain)
|
|
|
|
|
2013-12-12 15:09:53 +01:00
|
|
|
# Access the GPU.
|
|
|
|
allow surfaceflinger gpu_device:chr_file rw_file_perms;
|
|
|
|
|
2013-10-29 19:42:40 +01:00
|
|
|
# Access /dev/graphics/fb0.
|
|
|
|
allow surfaceflinger graphics_device:dir search;
|
|
|
|
allow surfaceflinger graphics_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Access /dev/video1.
|
2014-01-06 21:39:19 +01:00
|
|
|
allow surfaceflinger video_device:dir r_dir_perms;
|
2013-10-29 19:42:40 +01:00
|
|
|
allow surfaceflinger video_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Create and use netlink kobject uevent sockets.
|
2014-02-24 21:06:11 +01:00
|
|
|
allow surfaceflinger self:netlink_kobject_uevent_socket create_socket_perms;
|
2013-10-29 19:42:40 +01:00
|
|
|
|
|
|
|
# Set properties.
|
|
|
|
allow surfaceflinger system_prop:property_service set;
|
2014-02-18 19:24:26 +01:00
|
|
|
allow surfaceflinger ctl_bootanim_prop:property_service set;
|
2013-10-29 19:42:40 +01:00
|
|
|
|
|
|
|
# Use open files supplied by an app.
|
|
|
|
allow surfaceflinger appdomain:fd use;
|
|
|
|
allow surfaceflinger app_data_file:file { read write };
|
2013-12-11 21:17:53 +01:00
|
|
|
|
|
|
|
# Use open file provided by bootanim.
|
|
|
|
allow surfaceflinger bootanim:fd use;
|
2014-01-06 23:04:34 +01:00
|
|
|
|
|
|
|
# Allow a dumpstate triggered screenshot
|
|
|
|
binder_call(surfaceflinger, dumpstate)
|
2014-01-07 19:25:25 +01:00
|
|
|
binder_call(surfaceflinger, shell)
|
2014-03-21 15:36:24 +01:00
|
|
|
r_dir_file(surfaceflinger, dumpstate)
|
2014-01-08 20:19:52 +01:00
|
|
|
|
|
|
|
# Needed on some devices for playing DRM protected content,
|
|
|
|
# but seems expected and appropriate for all devices.
|
|
|
|
allow surfaceflinger tee:unix_stream_socket connectto;
|
|
|
|
allow surfaceflinger tee_device:chr_file rw_file_perms;
|
2014-03-05 16:17:16 +01:00
|
|
|
|
2014-12-12 01:01:27 +01:00
|
|
|
|
|
|
|
# media.player service
|
|
|
|
allow surfaceflinger mediaserver_service:service_manager find;
|
2015-04-08 22:04:59 +02:00
|
|
|
allow surfaceflinger permission_service:service_manager find;
|
|
|
|
allow surfaceflinger power_service:service_manager find;
|
2014-12-12 01:01:27 +01:00
|
|
|
allow surfaceflinger surfaceflinger_service:service_manager { add find };
|
2015-04-09 00:12:24 +02:00
|
|
|
allow surfaceflinger window_service:service_manager find;
|
2015-01-17 00:52:01 +01:00
|
|
|
|
2014-03-05 16:17:16 +01:00
|
|
|
###
|
|
|
|
### Neverallow rules
|
|
|
|
###
|
|
|
|
### surfaceflinger should NEVER do any of this
|
|
|
|
|
|
|
|
# Do not allow accessing SDcard files as unsafe ejection could
|
|
|
|
# cause the kernel to kill the process.
|
2014-06-09 07:30:58 +02:00
|
|
|
neverallow surfaceflinger sdcard_type:file rw_file_perms;
|