Skip to content
Snippets Groups Projects
Select Git revision
  • ae4b79cefd7cbb04175c9ac1ab8ed95859b08263
  • 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

sgdisk.te

Blame
    • Jeff Sharkey's avatar
      8188830e
      sgdisk: devpts and reload partition tables. · 8188830e
      Jeff Sharkey authored
      Add rules to let sgdisk read/write to pts when forked from vold.
      
      avc: denied { read write } for path="/dev/pts/14" dev="devpts" ino=17 scontext=u:r:sgdisk:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=0
      
      Also add rule to let it kick kernel to reload partition tables after
      we finish editing them.  Without this capability, it leaves this
      message and violation:
      
      Warning: The kernel is still using the old partition table.
      The new table will be used at the next reboot.
      GPT data structures destroyed! You may now partition the disk using fdisk or
      other utilities.
      
      avc: denied { sys_admin } for capability=21 scontext=u:r:sgdisk:s0 tcontext=u:r:sgdisk:s0 tclass=capability permissive=0
      
      Change-Id: If26a40f9fd3b1ab2c50156ae8bdb128676521b57
      8188830e
      History
      sgdisk: devpts and reload partition tables.
      Jeff Sharkey authored
      Add rules to let sgdisk read/write to pts when forked from vold.
      
      avc: denied { read write } for path="/dev/pts/14" dev="devpts" ino=17 scontext=u:r:sgdisk:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=0
      
      Also add rule to let it kick kernel to reload partition tables after
      we finish editing them.  Without this capability, it leaves this
      message and violation:
      
      Warning: The kernel is still using the old partition table.
      The new table will be used at the next reboot.
      GPT data structures destroyed! You may now partition the disk using fdisk or
      other utilities.
      
      avc: denied { sys_admin } for capability=21 scontext=u:r:sgdisk:s0 tcontext=u:r:sgdisk:s0 tclass=capability permissive=0
      
      Change-Id: If26a40f9fd3b1ab2c50156ae8bdb128676521b57
    sgdisk.te 745 B
    # sgdisk called from vold
    type sgdisk, domain;
    type sgdisk_exec, exec_type, file_type;
    
    # Allowed to read/write low-level partition tables
    allow sgdisk block_device:dir search;
    allow sgdisk vold_device:blk_file rw_file_perms;
    
    # Inherit and use pty created by android_fork_execvp()
    allow sgdisk devpts:chr_file { read write ioctl getattr };
    
    # Allow stdin/out back to vold
    allow sgdisk vold:fd use;
    allow sgdisk vold:fifo_file { read write getattr };
    
    # Used to probe kernel to reload partition tables
    allow sgdisk self:capability sys_admin;
    
    # Only allow entry from vold
    neverallow { domain -vold } sgdisk:process transition;
    neverallow domain sgdisk:process dyntransition;
    neverallow sgdisk { file_type fs_type -sgdisk_exec }:file entrypoint;