Skip to content
Snippets Groups Projects
  • Sami Tolvanen's avatar
    35f537c7
    Allow init to set up dm-verity · 35f537c7
    Sami Tolvanen authored
    Allow init to
    
     1. Access device mapper to set up dm-verity devices
    
        avc:  denied  { write } for  pid=156 comm="init" name="device-mapper" dev="tmpfs" ino=6229 scontext=u:r:init:s0 tcontext=u:object_r:dm_device:s0 tclass=chr_file permissive=0
    
     2. Access the metadata partition to load and store dm-verity state
    
        avc:  denied  { write } for  pid=1 comm="init" name="mmcblk0p25" dev="tmpfs" ino=6408 scontext=u:r:init:s0 tcontext=u:object_r:metadata_block_device:s0 tclass=blk_file permissive=0
    
     3. Read /sys/fs/pstore/console-ramoops to detect restarts triggered
        by dm-verity
    
        avc:  denied  { getattr } for  pid=1 comm="init" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9911 scontext=u:r:init:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=0
    
    These can be reproduced using the following steps:
    
     1. Add fs_mgr flag verify to the system partition in fstab
    
     2. Add a device specific init.rc handler for the init action that
        calls the built-in command verity_load_state.
    
    Change-Id: Id8790ae4b204ca66e671eefd3820d649f1d1e7ba
    35f537c7
    History
    Allow init to set up dm-verity
    Sami Tolvanen authored
    Allow init to
    
     1. Access device mapper to set up dm-verity devices
    
        avc:  denied  { write } for  pid=156 comm="init" name="device-mapper" dev="tmpfs" ino=6229 scontext=u:r:init:s0 tcontext=u:object_r:dm_device:s0 tclass=chr_file permissive=0
    
     2. Access the metadata partition to load and store dm-verity state
    
        avc:  denied  { write } for  pid=1 comm="init" name="mmcblk0p25" dev="tmpfs" ino=6408 scontext=u:r:init:s0 tcontext=u:object_r:metadata_block_device:s0 tclass=blk_file permissive=0
    
     3. Read /sys/fs/pstore/console-ramoops to detect restarts triggered
        by dm-verity
    
        avc:  denied  { getattr } for  pid=1 comm="init" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9911 scontext=u:r:init:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=0
    
    These can be reproduced using the following steps:
    
     1. Add fs_mgr flag verify to the system partition in fstab
    
     2. Add a device specific init.rc handler for the init action that
        calls the built-in command verity_load_state.
    
    Change-Id: Id8790ae4b204ca66e671eefd3820d649f1d1e7ba
init.te 9.23 KiB