Skip to content
Snippets Groups Projects
  1. Aug 01, 2017
    • Manoj Gupta's avatar
      Fix static analyzer warnings. · 3cdd4a4b
      Manoj Gupta authored
      Fix the following warnings:
      
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:346:9: warning:
      Potential leak of memory pointed to by '__s1'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:346:9: warning:
      Potential leak of memory pointed to by 'id'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:364:13: warning:
      Potential leak of memory pointed to by 'classperms'
      system/sepolicy/tools/sepolicy-analyze/neverallow.c:364:13: warning:
      Potential leak of memory pointed to by 'node'
      
      Bug: b/27101951
      Test:Warnings are gone.
      Change-Id: Ib9b2e0b9f19950b4b764d438ee58340e6c022ef5
      3cdd4a4b
  2. Apr 28, 2017
    • Andreas Gampe's avatar
      fc_sort: Fix leaks · c32d7bae
      Andreas Gampe authored
      Use the getline API correctly: keep a single buffer as long as
      possible, and let the callee handle re-allocation. Move the final
      free out of the loop.
      
      Release the head of the linked list.
      
      Bug: 37757586
      Test: ASAN_OPTIONS= SANITIZE_HOST=address mmma system/sepolicy
      Change-Id: I42424acba7cd68c1b9a7a43e916a421ac3e253f7
      c32d7bae
    • Andreas Gampe's avatar
      Sepolicy-Analyze: Plug leak · ee8b67df
      Andreas Gampe authored
      Destroy the policy before exiting (for successful = expected runs).
      
      Bug: 37757759
      Test: ASAN_OPTIONS= SANITIZE_HOST=address m
      Change-Id: I67e35fbede696ec020a53b69a6cef9f374fae167
      ee8b67df
  3. Apr 25, 2017
    • Alex Klyubin's avatar
      Do not warn about empty typesets in neverallows · c60d3ea1
      Alex Klyubin authored
      Empty typeset is not an issue in neverallow rules. The reason is that
      it's completly normal for scontext or tcontext of neverallow rules to
      evaluate to an empty type set. For example, there are neverallow rules
      whose purpose is to test that all types with particular powers are
      associated with a particular attribute:
        neverallow {
          untrusted_app_all
          -untrusted_app
          -untrusted_app_25
        } domain:process fork;
      
      Test: sepolicy-analyze neverallow -w -n \
                'neverallow {} {}:binder call;'
            produces empty output instead of "Warning!  Empty type set"
      Bug: 37357742
      Change-Id: Id61b4fe22fafaf0522d8769dd4e23dfde6cd9f45
      c60d3ea1
  4. Apr 18, 2017
  5. Apr 11, 2017
    • Sandeep Patil's avatar
      sepolicy_version: change current version to NN.m format · 9a3a6a81
      Sandeep Patil authored
      
      The sepolicy version takes SDK_INT.<minor> format. Make sure our
      'current' policy version reflects the format and make it '100000.0'.
      This ensures any vendor.img compiled with this will never work with
      a production framework image either.
      
      Make version_policy replace the '.' in version by '_' so secilc is
      happy too.
      
      This unblocks libvintf from giving out a runtme API to check vendor's
      sepolicy version. The PLAT_PUBLIC_SEPOLICY_CURRENT_VERSION will
      eventually be picked up from the build system.
      
      (cherry-pick of commit 42f95984)
      
      Bug: 35217573
      Test: Build and boot sailfish.
            Boot sailfish with sepolicy compilation on device.
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      
      Change-Id: Ic8b6687c4e71227bf9090018999149cd9e11d63b
      9a3a6a81
  6. Apr 07, 2017
    • Sandeep Patil's avatar
      sepolicy_version: change current version to NN.m format · 42f95984
      Sandeep Patil authored
      
      The sepolicy version takes SDK_INT.<minor> format. Make sure our
      'current' policy version reflects the format and make it '100000.0'.
      This ensures any vendor.img compiled with this will never work with
      a production framework image either.
      
      Make version_policy replace the '.' in version by '_' so secilc is
      happy too.
      
      This unblocks libvintf from giving out a runtme API to check vendor's
      sepolicy version. The PLAT_PUBLIC_SEPOLICY_CURRENT_VERSION will
      eventually be picked up from the build system.
      
      Bug: 35217573
      Test: Build and boot sailfish.
            Boot sailfish with sepolicy compilation on device.
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      
      Change-Id: Ic8b6687c4e71227bf9090018999149cd9e11d63b
      42f95984
    • Martijn Coenen's avatar
      Modify checkfc to check (vnd|hw)service_manager_type. · d48d54a3
      Martijn Coenen authored
      added checkfc options 'l' and 'v' to verify hwservice_manager_type
      and vndservice_manager_type on service context files, respectively.
      
      The checkfc call to verify the new hwservice_contexts files will
      be added together with hwservicemanager ACL CLs later.
      
      Bug: 34454312
      Bug: 36052864
      Test: device boots, works
      Change-Id: Ie3b56da30be47c95a6b05d1bc5e5805acb809783
      d48d54a3
  7. Apr 06, 2017
    • Dan Cashman's avatar
      Add reverse-attribute mapping to sepolicy-analyze. · 3a68bd16
      Dan Cashman authored
      sepolicy-analyze allows users to see all types that have a given
      attribute, but not the reverse case: all attributes of a given type.
      Add a '--reverse' option which enables this, but keeps the previous
      interface.
      
      Usage: sepolicy-analyze sepolicy attribute -r init
      
      Bug: 36508258
      Test: Build and run against current policy.
      
      (cherry picked from commit d444ebed)
      
      Change-Id: I9813ebf61d50fb5abbc8e52be4cf62751979bbd4
      3a68bd16
  8. Mar 31, 2017
    • Dan Cashman's avatar
      Add reverse-attribute mapping to sepolicy-analyze. · d444ebed
      Dan Cashman authored
      sepolicy-analyze allows users to see all types that have a given
      attribute, but not the reverse case: all attributes of a given type.
      Add a '--reverse' option which enables this, but keeps the previous
      interface.
      
      Usage: sepolicy-analyze sepolicy attribute -r init
      
      Bug: 36508258
      Test: Build and run against current policy.
      Change-Id: Ice6893cf7aa2ec4706a7411645a8e0a8a3ad01eb
      d444ebed
  9. Feb 21, 2017
    • Chad Brubaker's avatar
      Add new untrusted_v2_app domain · a782a816
      Chad Brubaker authored
      untrusted_v2_app is basically a refinement of untrusted_app with legacy
      capabilities removed and potentially backwards incompatible changes.
      
      This is not currently hooked up to anything.
      
      Bug: 33350220
      Test: builds
      Change-Id: Ic9fad57476bc2b6022b1eaca8667bf6d844753c2
      a782a816
  10. Feb 14, 2017
    • Michael Peck's avatar
      Add minTargetSdkVersion input selector to seapp_contexts · f54b3622
      Michael Peck authored
      This new input selector allows phasing in new security policies by
      giving app developers an opportunity to make any needed compatibility
      changes before updating each app's targetSdkVersion.
      
      When all else is equal, matching entries with higher
      minTargetSdkVersion= values are preferred over entries with lower
      minTargetSdkVersion= values.
      
      Test: Marlin builds and boots. Apps targeting targetSdkVersion<=25
      run in untrusted_app_25 domain. Apps targeting the current development
      build >=26 run in the untrusted_app domain with fewer permissions. No
      new denials observed during testing.
      Bug: 34115651
      Change-Id: I14bf4f51dbe26cb9bd3f62ad0b281085441d9806
      f54b3622
  11. Dec 12, 2016
  12. Dec 06, 2016
    • dcashman's avatar
      sepolicy: add version_policy tool and version non-platform policy. · 2e00e637
      dcashman authored
      In order to support platform changes without simultaneous updates from
      non-platform components, the platform and non-platform policies must be
      split.  In order to provide a guarantee that policy written for
      non-platform objects continues to provide the same access, all types
      exposed to non-platform policy are versioned by converting them and the
      policy using them into attributes.
      
      This change performs that split, the subsequent versioning and also
      generates a mapping file to glue the different policy components
      together.
      
      Test: Device boots and runs.
      Bug: 31369363
      Change-Id: Ibfd3eb077bd9b8e2ff3b2e6a0ca87e44d78b1317
      2e00e637
  13. Oct 19, 2016
    • William Roberts's avatar
      check_seapp: correct output on invalid policy file · f7d6bb3f
      William Roberts authored
      
      If in invalid policy file is loaded check_seapp outputs:
      
      Error: Could not lod policy file to db: Success!
      
      The "Success" value is from errno, which is not manipulated
      by libsepol. Also, load should have an a in it!
      
      Hardcode the error message to:
      
      Error: Could not load policy file to db: invalid input file!
      
      Test: That when providing an invalid sepolicy binary, that the output
      message is correct.
      Change-Id: Iaf1f85eeb217d484997ee1367d91d461c1195bf4
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      f7d6bb3f
  14. Oct 12, 2016
  15. Oct 07, 2016
  16. Sep 30, 2016
  17. Sep 23, 2016
    • bowgotsai's avatar
      Clean up LOCAL_C_INCLUDES · a6c215bc
      bowgotsai authored
      It should be specified by LOCAL_EXPORT_C_INCLUDE_DIRS from the imported
      libraries.
      
      Change-Id: I5b01ac24763a75984227d77671def6561325b7cc
      a6c215bc
  18. Aug 22, 2016
  19. Aug 19, 2016
    • Janis Danisevskis's avatar
      Port from pcre to pcre2 · a15ea578
      Janis Danisevskis authored
      Ports check_seapp to pcre2.
      
      Merged-In: Ib9977326cfbb19ce143b04504f41afb884f2ec17
      Bug: 24091652
      Change-Id: Ib9977326cfbb19ce143b04504f41afb884f2ec17
      a15ea578
  20. Aug 10, 2016
  21. May 11, 2016
    • Chih-Hung Hsieh's avatar
      Fix misc-macro-parentheses warnings. · 33500c91
      Chih-Hung Hsieh authored
      Add parentheses around macro arguments used beside binary operators.
      Use NOLINT comment to suppress false clang-tidy warnings.
      
      Bug: 28705665
      Change-Id: Idc7474c43da52a1ca6a690b56d8f637767adbb88
      33500c91
  22. Mar 30, 2016
  23. Feb 10, 2016
  24. Jan 29, 2016
  25. Jan 15, 2016
    • William Roberts's avatar
      fc_sort: initial commit · 49693f1b
      William Roberts authored
      
      Ordering matters in fc files; the last match wins. In builds where
      many BOARD_SEPOLICY_DIRS are set, the order of that list becomes
      increasingly important in order to maintain a cohesive built
      file_contexts.
      
      To correct this, we sort the device specific file_contexts entries
      with the upstream fc_sort tool.
      
      Change-Id: I3775eae11bfa5905cad0d02a0bf26c76ac03437c
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      49693f1b
    • William Roberts's avatar
      checkfc: do not die on 0 length fc's · 922b4e95
      William Roberts authored
      
      Checkfc was treating 0 size fc files as a fatal error.
      An empty fc file should be treated as "nothing to check"
      so long as the -e option is passed.
      
      We add this option, so we don't allow empty file_context
      files to pass CTS checking.
      
      Change-Id: Ibca6bd948a13389e10c605d613acc48c5504443e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      922b4e95
  26. Jan 14, 2016
  27. Jan 07, 2016
    • William Roberts's avatar
      fc_sort: initial commit · 29d14688
      William Roberts authored
      
      Ordering matters in fc files; the last match wins. In builds where
      many BOARD_SEPOLICY_DIRS are set, the order of that list becomes
      increasingly important in order to maintain a cohesive built
      file_contexts.
      
      To correct this, we sort the device specific file_contexts entries
      with the upstream fc_sort tool.
      
      Change-Id: Id79cc6f434c41179d5c0d0d739c4718918b0b1dc
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      29d14688
Loading