Skip to content
Snippets Groups Projects
  1. Oct 08, 2018
    • Tri Vo's avatar
      Unconditionally test mapping files. · 95cfd690
      Tri Vo authored
      Part of an effort to remove Treble-specifics in the way be build
      sepolicy.
      
      Fixes: 64541653
      Test: m selinux_policy for aosp_arm64
      Change-Id: I9e42c720018674e7d3a6c47e01995401c4e748a7
      95cfd690
  2. Sep 29, 2018
    • Tri Vo's avatar
      Don't require private types in mapping file. · e3f4f77d
      Tri Vo authored
      Private types are not visible to vendor/odm policy, so we don't need mapping
      entries for them.
      
      We build platform-only public policy .cil file and give it as input to
      treble_sepolicy_tests. Using this public policy the test can now figure out if
      the newly added type in public or private.
      
      Bug: 116344577
      Test: adding public type triggers mapping test failure, adding private type does
      not.
      Change-Id: I421f335e37274b24aa73109e260653d7b73788b5
      e3f4f77d
  3. Sep 26, 2018
    • huangyanjun's avatar
      Fix building error for multi-line dontaudit statement · 25095720
      huangyanjun authored
      All the *.conf.dontaudit files are generated from *.conf
      with the command of 'sed '/dontaudit/d' $@ > $@.dontaudit',
      but this command can not be applied to multi-line dontaudit statement.
      
      Test: Set plat_policy.conf.dontaudit as the input_file parameter of
      checkpolicy tool, then selinux syntax error will occur during building.
      
      Change-Id: I281de923d8a5f0b46256ec7de4df12a1c1d7e061
      25095720
  4. Sep 25, 2018
  5. Aug 15, 2018
    • Nick Kralevich's avatar
      m4: add --fatal-warnings · 764cbd06
      Nick Kralevich authored
      Error out if m4 generates a warning. This will help detect and prevent
      malformed macros.
      
      See 85508496 for motivation.
      
      Test: policy compiles
      Test: Policy doesn't compile if 85508496
            is reverted.
      
      Change-Id: Iee6b6273bc2a24b1220861fd662573e76001defc
      764cbd06
  6. Aug 08, 2018
    • Mark Salyzyn's avatar
      fs_mgr: add overlayfs handling for squashfs system filesystems · 9b398f3f
      Mark Salyzyn authored
      /cache/overlay directory in support of overlayfs mounts on userdebug
      and eng devices.  Overlayfs in turn can be capable of supporting
      adb remount for read-only or restricted-storage filesystems like
      squashfs or right-sized (zero free space) system partitions
      respectively.
      
      Test: compile
      Bug: 109821005
      Bug: 110985612
      Change-Id: I3ece03886db7cc97f864497cf93ec6c6c39bccd1
      9b398f3f
  7. Jul 19, 2018
    • Jae Shin's avatar
      Add mapping files for 28.0.[ignore.]cil · 1fa96348
      Jae Shin authored
      Steps taken to produce the mapping files:
      
      1. Add prebuilts/api/28.0/[plat_pub_versioned.cil|vendor_sepolicy.cil]
      from the /vendor/etc/selinux/[plat_pub_versioned.cil|vendor_sepolicy.cil]
      files built on pi-dev with lunch target aosp_arm64-eng
      
      2. Add new file private/compat/28.0/28.0.cil by doing the following:
      - copy /system/etc/selinux/mapping/28.0.cil from pi-dev aosp_arm64-eng
      device to private/compat/28.0/28.0.cil
      - remove all attribute declaration statement (typeattribute ...) and
      sort lines alphabetically
      - some selinux types were added/renamed/deleted w.r.t 28 sepolicy.
      Find all such types using treble_sepolicy_tests_28.0 test.
      - for all these types figure out where to map them by looking at
      27.0.[ignore.]cil files and add approprite entries to 28.0.[ignore.]cil.
      
      This change also enables treble_sepolicy_tests_28.0 and install 28.0.cil
      mapping onto the device.
      
      Bug: 72458734
      Test: m selinux_policy
      Change-Id: I90e17c0b43af436da4b62c16179c198b5c74002c
      1fa96348
  8. Jul 03, 2018
    • Anton Hansson's avatar
      Split selinux_policy module into two. · 8cfe1e61
      Anton Hansson authored
      Create one _system and one _nonsystem target, which together contains
      the same artifacts as before, just split by whether they go on the
      system partition or not.
      
      The product build hierarchy is being refactored to be split by
      partition, so these targets facilitate inclusion of just the
      system parts where necessary. Also keep the selinux_policy target
      around for products that don't need the split.
      
      Bug: 80410283
      Test: for t in eng userdebug user; do lunch mainline_arm64-${t}; m nothing; done
      Test: verified walleye /system and /vendor identical before and after, via:
      Test: /google/data/rw/users/cc/ccross/bin/compare-target-files.sh P6259983 walleye-userdebug "SYSTEM/*" "VENDOR/*"
      Test: only diffs are in build.prop files (timestamps and the like)
      
      Change-Id: I0f5d8a1558a164ce5cfb7d521f34b431855ac260
      8cfe1e61
  9. Jun 06, 2018
    • Tri Vo's avatar
      Mechanism to exclude neverallows from *TS. · 77c44fc4
      Tri Vo authored
      build_test_only is used to denote rules that should not verified
      as part of compliance testing.
      
      Use this macro to exclude neverallow rules which we want to check as
      part of build, but not CTS.
      
      Bug: 80499271
      Test: SELinuxNeverallowRulesTest on walleye has no more failure of type
      "Type or attribute * used in neverallow undefined in policy being checked."
      Number of failing test cases is reduced by 142.
      Test: policy.conf used to check neverallows at build-time still retains
      all neverallow rules.
      Change-Id: I5f1b383d9096bb5a7b8c0f1bc008b5dd07419580
      77c44fc4
  10. May 22, 2018
    • Joel Galenson's avatar
      Exclude bug_map from the sepolicy_freeze_test. · 98f83b67
      Joel Galenson authored
      The bug_map file is only used whitelisting known test failures.  It
      needs to change fairly often to fix new failures and it doesn't affect
      users, so it shouldn't matter if it diverges from prebuilts.
      
      Test: Enable this test and build with and without different bug_maps.
      Change-Id: I9176a6c7e9f7852a0cd7802fd121b1e86b216b22
      98f83b67
  11. May 16, 2018
    • Pavel Maltsev's avatar
      Allow to specify platform sepolicy dir mult. times · fdec2530
      Pavel Maltsev authored
      For automotive (and I assume for other verticals) it make sense to keep
      vertical-specific policies outside of /system/sepolicy as those not used
      by the phones. However, there's no way to do it rather than using
      BOARD_PLAT_{PUBLIC|PRIVATE}_SEPOLICY_DIR build variables.
      
      Bug: 70637118
      Test: lunch device && m
      Test: verify it builds, boots and logs seems to be reasonable
      Test: enable full treble for aosp_car_x86 - verify it builds, boots and
      no denials in the logs
      
      Change-Id: Ia5fd847f7a6152ff6cf99bbbc12e1e322f7946ab
      (cherry picked from commit 34f23364)
      fdec2530
  12. May 15, 2018
    • Pavel Maltsev's avatar
      Allow to specify platform sepolicy dir mult. times · 34f23364
      Pavel Maltsev authored
      For automotive (and I assume for other verticals) it make sense to keep
      vertical-specific policies outside of /system/sepolicy as those not used
      by the phones. However, there's no way to do it rather than using
      BOARD_PLAT_{PUBLIC|PRIVATE}_SEPOLICY_DIR build variables.
      
      Bug: 70637118
      Test: lunch bat_land-userdebug && m
      Test: verify it builds, boots and logs seems to be reasonable
      Test: enable full treble for aosp_car_x86 - verify it builds, boots and
      no denials in the logs
      
      Change-Id: Ia5fd847f7a6152ff6cf99bbbc12e1e322f7946ab
      34f23364
  13. May 09, 2018
  14. May 08, 2018
    • Tri Vo's avatar
      Soong module selinux compat maps · a5cfd3e5
      Tri Vo authored
      And migrate 26.0.cil and 27.0.cil build targets from Android.mk to
      Android.bp
      
      Bug: 33691272
      Test: 26.0.cil and 27.0.cil mapping files on the device are unchanged.
      Change-Id: Id0ea45c149e096996bc0657615ea98915df3c9e1
      a5cfd3e5
  15. Mar 30, 2018
    • Tri Vo's avatar
      Test frozen sepolicy has not diverged from prebuilts. · 321e1b05
      Tri Vo authored
      This will test that system/sepolicy/{public/, private/} are identical to
      prebuilts if PLATFORM_SEPOLICY_VERSION is not 10000.0.
      
      Bug: 74622750
      Test: build policy
      Test: correctly catches divergence from prebuilts for frozen policies
      
      Change-Id: I2fa14b672544a021c2d42ad5968dfbac21b72f6a
      (cherry picked from commit 81198bb8)
      321e1b05
  16. Mar 29, 2018
    • Tri Vo's avatar
      Test frozen sepolicy has not diverged from prebuilts. · 81198bb8
      Tri Vo authored
      This will test that system/sepolicy/{public/, private/} are identical to
      prebuilts if PLATFORM_SEPOLICY_VERSION is not 10000.0.
      
      Bug: 74622750
      Test: build policy
      Test: correctly catches divergence from prebuilts for frozen policies
      
      Change-Id: I2fa14b672544a021c2d42ad5968dfbac21b72f6a
      81198bb8
  17. Mar 27, 2018
    • Joel Galenson's avatar
      Use user policy for compatibility tests. · 408584d5
      Joel Galenson authored
      Use the user policy when running the compatibility tests.
      
      Bug: 74344625
      Test: Built policy for many devices.  Booted one device.
      Test: Delete some compat rules, verify error on userdebug.
      Change-Id: Ib2df2dfc06cdf55a839011e9a528e76160a9e436
      (cherry picked from commit c1486218)
      408584d5
    • Joel Galenson's avatar
      Use user policy for compatibility tests. · c1486218
      Joel Galenson authored
      Use the user policy when running the compatibility tests.
      
      Bug: 74344625
      Test: Built policy for many devices.  Booted one device.
      Test: Delete some compat rules, verify error on userdebug.
      Change-Id: Ib2df2dfc06cdf55a839011e9a528e76160a9e436
      c1486218
  18. Mar 26, 2018
    • Tom Cherry's avatar
      Verify the SELabels used in property_contexts · dc3e1dad
      Tom Cherry authored
      Verify that the SELabels used in property_contexts correspond to a
      real type in the SEPolicy and that this type has the property_type attribute.
      
      Additionally add a check that vendor property_context files do not
      duplicate entries in plat property_contexts, and a similar check that
      odm property_contexts doesn't duplicate either plat or vendor
      property_contexts.
      
      Bug: 74078792
      Test: Build property_contexts on bullhead successfully
      Test: See failure when using a faulty SELabel in property_contexts
      Test: See failure when duplicating label in vendor and plat property_contexts
      Change-Id: I4d2338dab68f1c5a8ed110aa7821f0677f61bafb
      (cherry picked from commit a15df75d)
      dc3e1dad
    • Tom Cherry's avatar
      Verify the SELabels used in property_contexts · a15df75d
      Tom Cherry authored
      Verify that the SELabels used in property_contexts correspond to a
      real type in the SEPolicy and that this type has the property_type attribute.
      
      Additionally add a check that vendor property_context files do not
      duplicate entries in plat property_contexts, and a similar check that
      odm property_contexts doesn't duplicate either plat or vendor
      property_contexts.
      
      Bug: 74078792
      Test: Build property_contexts on bullhead successfully
      Test: See failure when using a faulty SELabel in property_contexts
      Test: See failure when duplicating label in vendor and plat property_contexts
      Change-Id: I4d2338dab68f1c5a8ed110aa7821f0677f61bafb
      a15df75d
  19. Mar 21, 2018
    • Tri Vo's avatar
      Fix mapping file build. · bbb8f5bd
      Tri Vo authored
      Location of mapping files has changed from private/mapping/V.v.cil to
      private/compat/V.v/V.v.cil
      Change the build rule for current_mapping.cil to reflect that.
      
      Test: Build current mapping file with  BOARD_SEPOLICY_VERS := 27.0 and
      make sure that $OUT/obj/ETC/27.0.cil_intermediates/27.0.cil is not empty
      Change-Id: I996a717e1c659265cb067da5d621d71ff3b3b63b
      bbb8f5bd
  20. Mar 20, 2018
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_mac_permissions.xml · 1067bffa
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot a device
      Change-Id: I276ba6bc88eabb0d5562e4e96d3860eedb76aed5
      Merged-In: I276ba6bc88eabb0d5562e4e96d3860eedb76aed5
      (cherry picked from commit af7d85f8)
      1067bffa
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_hwservice_contexts · 13e5d757
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: I22d29e8476380d19aca1be359e0228ab6bbc3b0f
      Merged-In: I22d29e8476380d19aca1be359e0228ab6bbc3b0f
      (cherry picked from commit ad6231f5)
      13e5d757
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_property_contexts · 6d3822d4
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: Ibd71219f60644e57370c0293decf11d82f1cb35c
      Merged-In: Ibd71219f60644e57370c0293decf11d82f1cb35c
      (cherry picked from commit 1f717b10)
      6d3822d4
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_seapp_contexts · 82444056
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot a device
      Change-Id: I3626357237cc18a99511f1ebd9dd3ff5a7655963
      Merged-In: I3626357237cc18a99511f1ebd9dd3ff5a7655963
      (cherry picked from commit ecf656b0)
      82444056
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_file_contexts · d3e94f26
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: I087292fb23d05fc17272778d668ac78a721b2593
      Merged-In: I087292fb23d05fc17272778d668ac78a721b2593
      (cherry picked from commit bae1517a)
      d3e94f26
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_sepolicy.cil · 95fbf451
      Bowgo Tsai authored
      This change adds the support of odm sepolicy customization, which can
      be configured through the newly added build varaible:
          - BOARD_ODM_SEPOLICY_DIRS += device/${ODM_NAME}/${BOM_NAME}/sepolicy
      
      Also moving precompiled sepolicy to /odm when BOARD_ODM_SEPOLICY_DIRS
      is set. On a DUT, precompiled sepolicy on /odm will override the one in
      /vendor. This is intentional because /odm is the hardware customization
      for /vendor and both should be updated together if desired.
      
      Bug: 64240127
      Test: boot a device with /odm partition
      Change-Id: Ia8f81a78c88cbfefb3ff19e2ccd2648da6284d09
      Merged-In: Ia8f81a78c88cbfefb3ff19e2ccd2648da6284d09
      (cherry picked from commit 45457e3a)
      95fbf451
  21. Mar 16, 2018
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_mac_permissions.xml · af7d85f8
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot a device
      Change-Id: I276ba6bc88eabb0d5562e4e96d3860eedb76aed5
      af7d85f8
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_hwservice_contexts · ad6231f5
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: I22d29e8476380d19aca1be359e0228ab6bbc3b0f
      ad6231f5
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_property_contexts · 1f717b10
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: Ibd71219f60644e57370c0293decf11d82f1cb35c
      1f717b10
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_seapp_contexts · ecf656b0
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot a device
      Change-Id: I3626357237cc18a99511f1ebd9dd3ff5a7655963
      ecf656b0
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_file_contexts · bae1517a
      Bowgo Tsai authored
      Bug: 64240127
      Test: normal boot and recovery boot a device
      Change-Id: I087292fb23d05fc17272778d668ac78a721b2593
      bae1517a
    • Bowgo Tsai's avatar
      Add /odm/etc/selinux/odm_sepolicy.cil · 45457e3a
      Bowgo Tsai authored
      This change adds the support of odm sepolicy customization, which can
      be configured through the newly added build varaible:
          - BOARD_ODM_SEPOLICY_DIRS += device/${ODM_NAME}/${BOM_NAME}/sepolicy
      
      Also moving precompiled sepolicy to /odm when BOARD_ODM_SEPOLICY_DIRS
      is set. On a DUT, precompiled sepolicy on /odm will override the one in
      /vendor. This is intentional because /odm is the hardware customization
      for /vendor and both should be updated together if desired.
      
      Bug: 64240127
      Test: boot a device with /odm partition
      Change-Id: Ia8f81a78c88cbfefb3ff19e2ccd2648da6284d09
      45457e3a
  22. Mar 08, 2018
    • Joel Galenson's avatar
      Use user policy when checking neverallow rules. · 8c72eea5
      Joel Galenson authored
      When building userdebug or eng builds, we still want to build the user
      policy when checking neverallow rules so that we can catch compile
      errors.
      
      Commit c0713e86 split out a helper function but lost one instance of
      using user instead of the real variant.  This restores that one and
      adds it to the neverallow check.
      
      Bug: 74344625
      Test: Added a rule that referred to a type defined only
      in userdebug and eng and ensure we throw a compile error when building
      userdebug mode.
      
      Change-Id: I1a6ffbb36dbeeb880852f9cbac880f923370c2ae
      (cherry picked from commit 053cb341)
      8c72eea5
  23. Mar 07, 2018
    • Joel Galenson's avatar
      Use user policy when checking neverallow rules. · 053cb341
      Joel Galenson authored
      When building userdebug or eng builds, we still want to build the user
      policy when checking neverallow rules so that we can catch compile
      errors.
      
      Commit c0713e86 split out a helper function but lost one instance of
      using user instead of the real variant.  This restores that one and
      adds it to the neverallow check.
      
      Bug: 74344625
      Test: Added a rule that referred to a type defined only
      in userdebug and eng and ensure we throw a compile error when building
      userdebug mode.
      
      Change-Id: I1a6ffbb36dbeeb880852f9cbac880f923370c2ae
      053cb341
  24. Feb 27, 2018
  25. Feb 14, 2018
    • Jeff Vander Stoep's avatar
      Use SELINUX_IGNORE_NEVERALLOWS flag to disable all tests · 3d4965b2
      Jeff Vander Stoep authored
      The intent of this flag is to disable tests during early device
      bringup so that vendor drops can occur without build breakages.
      When SELINUX_IGNORE_NEVERALLOWS=true also disable labeling tests
      sepolicy_tests, and treble_sepolicy_tests.
      
      Bug: 73322735
      Test: build, verify known tests failures do not cause build breakage.
      Change-Id: I3e7165938d4e34c066bfa0a20e68b7e02dae4a24
      3d4965b2
  26. Feb 07, 2018
Loading