Skip to content
Snippets Groups Projects
  • Alex Klyubin's avatar
    446279a6
    Preserve treble-only flag for CTS neverallows · 446279a6
    Alex Klyubin authored
    CTS includes general_sepolicy.conf built from this project. CTS then
    tests this file's neverallow rules against the policy of the device
    under test. Prior to this commit, neverallow rules which must be
    enforced only for Treble devices we not included into
    general_sepolicy.conf. As a result, these rules were not enforced for
    Treble devices.
    
    This commit fixes the issue as follows. Because CTS includes only one
    policy, the policy now contains also the rules which are only for
    Treble devices. To enable CTS to distinguish rules needed for all
    devices from rules needed only on Treble devices, the latter rules are
    contained in sections delimited with BEGIN_TREBLE_ONLY and
    END_TREBLE_ONLY comments.
    
    This commit also removes the unnecessary sepolicy.general target. This
    target is not used anywhere and is causing trouble because it is
    verifying neverallows of the policy meant to be used by CTS. This
    policy can no longer be verified with checkpolicy without
    conditionally including or excluding Treble-only neverallows.
    
    Test: mmm system/sepolicy
    Test: Device boots -- no new denials
    Bug: 37082262
    Change-Id: I15172a7efd9374543ba521e17aead1bdda7451bf
    446279a6
    History
    Preserve treble-only flag for CTS neverallows
    Alex Klyubin authored
    CTS includes general_sepolicy.conf built from this project. CTS then
    tests this file's neverallow rules against the policy of the device
    under test. Prior to this commit, neverallow rules which must be
    enforced only for Treble devices we not included into
    general_sepolicy.conf. As a result, these rules were not enforced for
    Treble devices.
    
    This commit fixes the issue as follows. Because CTS includes only one
    policy, the policy now contains also the rules which are only for
    Treble devices. To enable CTS to distinguish rules needed for all
    devices from rules needed only on Treble devices, the latter rules are
    contained in sections delimited with BEGIN_TREBLE_ONLY and
    END_TREBLE_ONLY comments.
    
    This commit also removes the unnecessary sepolicy.general target. This
    target is not used anywhere and is causing trouble because it is
    verifying neverallows of the policy meant to be used by CTS. This
    policy can no longer be verified with checkpolicy without
    conditionally including or excluding Treble-only neverallows.
    
    Test: mmm system/sepolicy
    Test: Device boots -- no new denials
    Bug: 37082262
    Change-Id: I15172a7efd9374543ba521e17aead1bdda7451bf