Home | History | Annotate | Download | only in public
      1 # cameraserver - camera daemon
      2 type cameraserver, domain;
      3 type cameraserver_exec, exec_type, file_type;
      4 
      5 binder_use(cameraserver)
      6 binder_call(cameraserver, binderservicedomain)
      7 binder_call(cameraserver, appdomain)
      8 binder_service(cameraserver)
      9 
     10 hal_client_domain(cameraserver, hal_camera)
     11 
     12 hal_client_domain(cameraserver, hal_graphics_allocator)
     13 
     14 allow cameraserver ion_device:chr_file rw_file_perms;
     15 
     16 # Talk with graphics composer fences
     17 allow cameraserver hal_graphics_composer:fd use;
     18 
     19 add_service(cameraserver, cameraserver_service)
     20 
     21 allow cameraserver activity_service:service_manager find;
     22 allow cameraserver appops_service:service_manager find;
     23 allow cameraserver audioserver_service:service_manager find;
     24 allow cameraserver batterystats_service:service_manager find;
     25 allow cameraserver cameraproxy_service:service_manager find;
     26 allow cameraserver mediaserver_service:service_manager find;
     27 allow cameraserver processinfo_service:service_manager find;
     28 allow cameraserver scheduling_policy_service:service_manager find;
     29 allow cameraserver surfaceflinger_service:service_manager find;
     30 
     31 allow cameraserver hidl_token_hwservice:hwservice_manager find;
     32 
     33 ###
     34 ### neverallow rules
     35 ###
     36 
     37 # cameraserver should never execute any executable without a
     38 # domain transition
     39 neverallow cameraserver { file_type fs_type }:file execute_no_trans;
     40 
     41 # The goal of the mediaserver split is to place media processing code into
     42 # restrictive sandboxes with limited responsibilities and thus limited
     43 # permissions. Example: Audioserver is only responsible for controlling audio
     44 # hardware and processing audio content. Cameraserver does the same for camera
     45 # hardware/content. Etc.
     46 #
     47 # Media processing code is inherently risky and thus should have limited
     48 # permissions and be isolated from the rest of the system and network.
     49 # Lengthier explanation here:
     50 # https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
     51 neverallow cameraserver domain:{ tcp_socket udp_socket rawip_socket } *;
     52 
     53 # Allow shell commands from ADB for CTS testing/dumping
     54 allow cameraserver adbd:fd use;
     55 allow cameraserver adbd:unix_stream_socket { read write };
     56 allow cameraserver shell:fd use;
     57 allow cameraserver shell:unix_stream_socket { read write };
     58 allow cameraserver shell:fifo_file { read write };
     59 
     60 # Allow shell commands from ADB for CTS testing/dumping
     61 userdebug_or_eng(`
     62   allow cameraserver su:fd use;
     63   allow cameraserver su:fifo_file { read write };
     64   allow cameraserver su:unix_stream_socket { read write };
     65 ')
     66