Skip to content
Snippets Groups Projects
  • Stephen Smalley's avatar
    c626a882
    Allow init to relabel rootfs files. · c626a882
    Stephen Smalley authored
    
    This is required for the restorecon /adb_keys in init.rc or
    for any other relabeling of rootfs files to more specific types on
    kernels that support setting security contexts on rootfs inodes.
    
    Addresses denials such as:
      avc: denied { relabelfrom } for comm="init" name="adb_keys" dev="rootfs" ino=1917 scontext=u:r:init:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
    We do not need to prohibit relabelfrom of such files because our goal
    is to prevent writing to executable files, while relabeling the file
    to another type will take it to a non-executable (or non-writable) type.
    In contrast, relabelto must be prohibited by neverallow so that a
    modified file in a writable type cannot be made executable.
    
    Change-Id: I7595f615beaaa6fa524f3c32041918e197bfbebe
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
    c626a882
    History
    Allow init to relabel rootfs files.
    Stephen Smalley authored
    
    This is required for the restorecon /adb_keys in init.rc or
    for any other relabeling of rootfs files to more specific types on
    kernels that support setting security contexts on rootfs inodes.
    
    Addresses denials such as:
      avc: denied { relabelfrom } for comm="init" name="adb_keys" dev="rootfs" ino=1917 scontext=u:r:init:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
    We do not need to prohibit relabelfrom of such files because our goal
    is to prevent writing to executable files, while relabeling the file
    to another type will take it to a non-executable (or non-writable) type.
    In contrast, relabelto must be prohibited by neverallow so that a
    modified file in a writable type cannot be made executable.
    
    Change-Id: I7595f615beaaa6fa524f3c32041918e197bfbebe
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>