Skip to content
Snippets Groups Projects
  1. Jun 23, 2015
  2. Jun 19, 2015
    • William Roberts's avatar
      correct all error messages · 8d3a1b55
      William Roberts authored
      
      When an error occured it was erroneously being indicated that he
      file was the output file, not the input file.
      
      Before:
      Error: Could not find selinux type "fake_app" on line: 51 in file: out/target/product/flo/obj/ETC/seapp_contexts_intermediates/seapp_contexts
      Error: Could not validate
      Error: reading out/target/product/flo/obj/ETC/seapp_contexts_intermediates/seapp_contexts.tmp, line 51, name levelFrom, value user
      
      After:
      Error: Could not find selinux type "fake_app" on line: 51 in file: out/target/product/flo/obj/ETC/seapp_contexts_intermediates/seapp_contexts.tmp
      Error: Could not validate
      Error: reading out/target/product/flo/obj/ETC/seapp_contexts_intermediates/seapp_contexts.tmp, line 51, name levelFrom, value user
      
      Change-Id: Ib0e01f1f0ef563a2a150a0a3b4012e6e15d736bb
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      8d3a1b55
  3. Jun 12, 2015
    • William Roberts's avatar
      check_seapp: Correct output on duplicate entries · 773d4126
      William Roberts authored
      
      If a duplicate entry is found, rule_map_cmp() incorrectly
      assumes that the lengths of the key value pairs should be
      equal, when this is not true. The duplicate detection is
      done on the input parameters, thus the lengths can be
      different. This resulted in a duplicate error string
      message of "do not match", instead of "match on all inputs".
      
      Also, the file name printed that contained the error was
      the output file, not the input file that contained it.
      
      Change-Id: I9b3f99fa4aa3454849de55f18b198b0b56e44320
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      773d4126
  4. Feb 24, 2015
  5. Feb 13, 2015
    • Stephen Smalley's avatar
      checkseapp: Detect duplicate entries within seapp_contexts. · 0b820042
      Stephen Smalley authored
      
      Presently it only detects complete duplicates if you specify -s (strict),
      which is not used in the external/sepolicy Makefile, and it allows
      overriding earlier entries that have the same input selectors (e.g.
      user=, seinfo=) with different values for the output selectors (e.g.
      domain=, type=).  Thus, a device/<vendor>/<board>/sepolicy/seapp_contexts
      file can override the external/sepolicy definitions, and even a single
      seapp_contexts file can contain duplicated or conflicting definitions.
      
      Make it always check strictly, and prohibit either duplicates on the
      input selectors (i.e. overrides) or complete duplicates (redundant).
      
      Change-Id: Id1e38133cbe31b796253101cfe3b111d1826bc8c
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      0b820042
  6. Sep 15, 2014
  7. Apr 04, 2014
    • Stephen Smalley's avatar
      Treat seinfo=default name=<anything> as an error. · f4fa7567
      Stephen Smalley authored
      
      check_app already checks for usage of name= entries
      in seapp_contexts with no seinfo= specification to
      link it back to a signer in mac_permissions.xml.
      However, one can avoid this error by specifying
      a seinfo=default which merely matches the default
      stanza of mac_permissions.xml without actually ensuring
      that it is tied to a specific certificate.  Catch
      that error case too.
      
      Change-Id: If33cf21501e8bfee44d31c92b6341dfa583552b2
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      f4fa7567
  8. Feb 19, 2014
    • Stephen Smalley's avatar
      Add support for and use new path= specifier in seapp_contexts. · 6139de50
      Stephen Smalley authored
      
      Extend check_seapp to accept the use of the new path= specifier
      in seapp_contexts and use it to ensure proper labeling of the cache
      subdirectory of com.android.providers.downloads for restorecon.
      
      After this change, restorecon /data/data/com.android.providers.downloads/cache
      does not change the context, leaving it in download_file rather than
      relabeling it to platform_app_data_file.
      
      Depends on Iddaa3931cfd4ddd5b9f62cd66989e1f26553baa1.
      
      Change-Id: Ief65b8c8dcb44ec701d53e0b58c52d6688cc2a14
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      6139de50
  9. Nov 01, 2013
  10. Oct 31, 2013
    • Stephen Smalley's avatar
      Add sepolicy-analyze tool. · 7b2bee99
      Stephen Smalley authored
      
      And also remove the unnecessary references to libselinux for
      sepolicy-check, as it has no dependencies on libselinux.
      Also enable -Wall -Werror on building all of these tools and
      fix up all such errors.
      
      Usage:
      $ sepolicy-analyze -e -P out/target/product/<device>/root/sepolicy
      or
      $ sepolicy-analyze -d -P out/target/product/<device>/root/sepolicy
      
      The first form will display all type pairs that are "equivalent", i.e.
      they are identical with respect to allow rules, including indirect allow
      rules via attributes and default-enabled conditional rules (i.e. default
      boolean values yield a true conditional expression).
      
      Equivalent types are candidates for being coalesced into a single type.
      However, there may be legitimate reasons for them to remain separate,
      for example:
      - the types may differ in a respect not included in the current
      analysis, such as default-disabled conditional rules, audit-related
      rules (auditallow or dontaudit), default type transitions, or
      constraints (e.g. mls), or
      - the current policy may be overly permissive with respect to one or the
      other of the types and thus the correct action may be to tighten access
      to one or the other rather than coalescing them together, or
      - the domains that would in fact have different accesses to the types
      may not yet be defined or may be unconfined in the policy you are
      analyzing (e.g. in AOSP policy).
      
      The second form will display type pairs that differ and the first
      difference found between the two types.  This output can be long.
      
      We have plans to explore further enhancements to this tool, including
      support for identifying isomorphic types.  That will be required to
      identify similar domains since all domains differ in at least their
      entrypoint type and in their tmpfs type and thus will never show up as
      equivalent even if they are in all other respects identical to each other.
      
      Change-Id: If0ee00188469d2a1e165fdd52f235c705d22cd4e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      7b2bee99
  11. Oct 16, 2013
  12. Oct 15, 2013
    • William Roberts's avatar
      tools: drop unused field in struct · d1f1070a
      William Roberts authored
      check_seapp at one point in time switch from a home implementation
      of a hash table to using GLIBC search.h routines. A struct in one
      of the fields was never removed during this transition.
      
      Change-Id: I65c028103ffe90fa52e0b3c9fce28124ed9c7ff9
      d1f1070a
  13. Apr 29, 2013
  14. Apr 20, 2013
  15. Mar 20, 2013
    • Stephen Smalley's avatar
      Generalize levelFromUid support. · 38084146
      Stephen Smalley authored
      
      Introduce a levelFrom=none|app|user|all syntax for specifying
      per-app, per-user, or per-combination level assignment.
      levelFromUid=true|false remains valid syntax but is deprecated.
      levelFromUid=true is equivalent to levelFrom=app.
      
      Update check_seapp to accept the new syntax.
      Update seapp_contexts to document the new syntax and switch
      from levelFromUid=true to levelFrom=app.  No change in behavior.
      
      Change-Id: Ibaddeed9bc3e2586d524efc2f1faa5ce65dea470
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      38084146
  16. Nov 27, 2012
  17. Nov 01, 2012
  18. Oct 30, 2012
  19. Oct 23, 2012
  20. Sep 17, 2012
    • William Roberts's avatar
      Fix for segfault/jmp depends on unitialized variable · b3ab56c2
      William Roberts authored
      When realloc creates the first block of memory, it must
      be initialized to NULL for the following strcat functions
      to operate correctly.
      
      Change-Id: I98fc14e1b19de5aa205354d16e54445293430d8e
      b3ab56c2
    • William Roberts's avatar
      Fix check_seapp segfault and undefined linking err · a53ccf39
      William Roberts authored
      When LINK_SEPOL_STATIC was not defined, symbol
      log_warning was trying to be resolved by the linker.
      That symbol was not defined as it should have been
      log_warn and not log_warning.
      
      When a key would be validated in key_map_validate(), an
      unchecked key, like user, could cuase a segfault when
      the se_key was getting free'd no matter what at the end
      of the function, even if no se_key was alloc'd.
      
      Change-Id: If334ba7350e6d2ad1fa9bed142bb2fabe7caa057
      a53ccf39
  21. Sep 05, 2012
  22. Sep 04, 2012
Loading