Skip to content
Snippets Groups Projects
  • Nick Kralevich's avatar
    Remove legacy execmod access from API >= 26. · f3eb9854
    Nick Kralevich authored
    Text relocation support was removed from the linker for apps targeting
    API >= 23. See
    https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#text-relocations-enforced-for-api-level-23
    
    However, the security policy was not updated to remove the execmod
    permission at that time, since we didn't have support for targeting
    SELinux policies to API versions.
    
    Remove execmod permissions for apps targeting API 26 or greater. The
    linker support was removed, so it's pointless to keep around the SELinux
    permissions.
    
    Retain execmod support for apps targeting API 25 or lower. While in
    theory we could remove support for API 23-25, that would involve the
    introduction of a new SELinux domain (and the associated rule
    explosion), which I would prefer to avoid.
    
    This change helps protect application executable code from modification,
    enforcing W^X properties on executable code pages loaded from files.
    https://en.wikipedia.org/wiki/W%5EX
    
    Test: auditallow rules were added and nothing triggered for apps
          targeting API >= 26. Code compiles and device boots.
    Bug: 111544476
    
    Change-Id: Iab9a0bd297411e99699e3651c110e57eb02a3a41
    f3eb9854
untrusted_app_25.te 2.30 KiB