Skip to content
Snippets Groups Projects
  • Stephen Smalley's avatar
    3235f61a
    Restrict /data/security and setprop selinux.reload_policy access. · 3235f61a
    Stephen Smalley authored
    
    Remove /data/security and setprop selinux.reload_policy access
    from unconfineddomain, and only add back what is needed to
    init (system_server already gets the required allow rules via
    the selinux_manage_policy macro).
    
    init (via init.rc post-fs-data) originally creates /data/security
    and may later restorecon it.  init also sets the property (also from
    init.rc post-fs-data) to trigger a reload once /data is mounted.
    The system_server (SELinuxPolicyInstallReceiver in particular) creates
    subdirectories under /data/security for updates, writes files to these
    subdirectories, creates the /data/security/current symlink to the update
    directory, and sets the property to trigger a reload when an update bundle
    is received.
    
    Add neverallow rules to ensure that we do not allow undesired access
    to security_file or security_prop.
    
    This is only truly meaningful if the support for /data/security policies
    is restored, but is harmless otherwise.
    
    Also drop the persist.mmac property_contexts entry; it was never used in
    AOSP, only in our tree (for middleware MAC) and is obsolete.
    
    Change-Id: I5ad5e3b6fc7abaafd314d31723f37b708d8fcf89
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
    3235f61a
    History
    Restrict /data/security and setprop selinux.reload_policy access.
    Stephen Smalley authored
    
    Remove /data/security and setprop selinux.reload_policy access
    from unconfineddomain, and only add back what is needed to
    init (system_server already gets the required allow rules via
    the selinux_manage_policy macro).
    
    init (via init.rc post-fs-data) originally creates /data/security
    and may later restorecon it.  init also sets the property (also from
    init.rc post-fs-data) to trigger a reload once /data is mounted.
    The system_server (SELinuxPolicyInstallReceiver in particular) creates
    subdirectories under /data/security for updates, writes files to these
    subdirectories, creates the /data/security/current symlink to the update
    directory, and sets the property to trigger a reload when an update bundle
    is received.
    
    Add neverallow rules to ensure that we do not allow undesired access
    to security_file or security_prop.
    
    This is only truly meaningful if the support for /data/security policies
    is restored, but is harmless otherwise.
    
    Also drop the persist.mmac property_contexts entry; it was never used in
    AOSP, only in our tree (for middleware MAC) and is obsolete.
    
    Change-Id: I5ad5e3b6fc7abaafd314d31723f37b708d8fcf89
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>