Skip to content
Snippets Groups Projects
Select Git revision
  • b51c4dd39a6f6ab82e093173120771d4b0ba2490
  • master default protected
  • android-7.1.2_r28_klist
  • pie-cts-release
  • pie-vts-release
  • pie-cts-dev
  • oreo-mr1-iot-release
  • sdk-release
  • oreo-m6-s4-release
  • oreo-m4-s12-release
  • pie-release
  • pie-r2-release
  • pie-r2-s1-release
  • oreo-vts-release
  • oreo-cts-release
  • oreo-dev
  • oreo-mr1-dev
  • pie-gsi
  • pie-platform-release
  • pie-dev
  • oreo-cts-dev
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
  • android-9.0.0_r3
41 results

sdcardd.te

Blame
    • Nick Kralevich's avatar
      5fc825c9
      sdcardd: grant unmount · 5fc825c9
      Nick Kralevich authored
      If the sdcard daemon is restarted (crash or otherwise), one of the first
      things it attempts to do is umount the previously mounted /mnt/shell/emulated
      fuse filesystem, which is denied by SELinux with the following denial:
      
        sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0
      
      Allow the operation.
      
      Steps to reproduce:
      
        1) adb shell into the device and su to root
        2) run "kill -9 [PID OF SDCARD]
      
      Expected:
      
        sdcard daemon successfully restarts without error message.
      
      Actual:
      
        SELinux denial above, plus attempts to mount a new filesystem
        on top of the existing filesystem.
      
      (cherrypicked from commit abfd427a)
      
      Bug: 17383009
      Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
      5fc825c9
      History
      sdcardd: grant unmount
      Nick Kralevich authored
      If the sdcard daemon is restarted (crash or otherwise), one of the first
      things it attempts to do is umount the previously mounted /mnt/shell/emulated
      fuse filesystem, which is denied by SELinux with the following denial:
      
        sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0
      
      Allow the operation.
      
      Steps to reproduce:
      
        1) adb shell into the device and su to root
        2) run "kill -9 [PID OF SDCARD]
      
      Expected:
      
        sdcard daemon successfully restarts without error message.
      
      Actual:
      
        SELinux denial above, plus attempts to mount a new filesystem
        on top of the existing filesystem.
      
      (cherrypicked from commit abfd427a)
      
      Bug: 17383009
      Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
    app.te 13.13 KiB
    ###
    ### Domain for all zygote spawned apps
    ###
    ### This file is the base policy for all zygote spawned apps.
    ### Other policy files, such as isolated_app.te, untrusted_app.te, etc
    ### extend from this policy. Only policies which should apply to ALL
    ### zygote spawned apps should be added here.
    ###
    
    # Dalvik Compiler JIT Mapping.
    allow appdomain self:process execmem;
    allow appdomain ashmem_device:chr_file execute;
    
    # Receive and use open file descriptors inherited from zygote.
    allow appdomain zygote:fd use;
    
    # gdbserver for ndk-gdb reads the zygote.
    # valgrind needs mmap exec for zygote
    allow appdomain zygote_exec:file rx_file_perms;
    
    # gdbserver for ndk-gdb ptrace attaches to app process.
    allow { appdomain -isolated_app } self:process ptrace;
    
    # Read system properties managed by zygote.
    allow appdomain zygote_tmpfs:file read;
    
    # Notify zygote of death;
    allow appdomain zygote:process sigchld;
    
    # Notify shell and adbd of death when spawned via runas for ndk-gdb.
    allow appdomain shell:process sigchld;
    allow appdomain adbd:process sigchld;
    
    # child shell or gdbserver pty access for runas.
    allow appdomain devpts:chr_file { getattr read write ioctl };
    
    # Use pipes and sockets provided by system_server via binder or local socket.
    allow appdomain system_server:fifo_file rw_file_perms;
    allow appdomain system_server:unix_stream_socket { read write setopt getattr getopt shutdown };
    allow appdomain system_server:tcp_socket { read write getattr getopt shutdown };
    
    # Communication with other apps via fifos
    allow appdomain appdomain:fifo_file rw_file_perms;
    
    # Communicate with surfaceflinger.
    allow appdomain surfaceflinger:unix_stream_socket { read write setopt getattr getopt shutdown };
    
    # App sandbox file accesses.
    allow { appdomain -isolated_app } app_data_file:dir create_dir_perms;
    allow { appdomain -isolated_app } app_data_file:notdevfile_class_set create_file_perms;
    
    # lib subdirectory of /data/data dir is system-owned.
    allow appdomain system_data_file:dir r_dir_perms;
    allow appdomain system_data_file:file { execute execute_no_trans open execmod };
    
    # Keychain and user-trusted credentials
    allow appdomain keychain_data_file:dir r_dir_perms;
    allow appdomain keychain_data_file:file r_file_perms;
    allow appdomain misc_user_data_file:dir r_dir_perms;
    allow appdomain misc_user_data_file:file r_file_perms;
    
    # Access to OEM provided data and apps
    allow appdomain oemfs:dir r_dir_perms;
    allow appdomain oemfs:file rx_file_perms;
    
    # Execute the shell or other system executables.
    allow appdomain shell_exec:file rx_file_perms;
    allow appdomain system_file:file rx_file_perms;
    
    # Execute dex2oat when apps call dexclassloader