1. 20 May, 2015 1 commit
    • Colin Cross's avatar
      Rename Blueprints to Android.bp · 922be57d
      Colin Cross authored
      Rename module definition files to Android.bp to avoid conflicts
      with another project called Blueprint.
      
      Change-Id: Iffba1becf0122d386bac9183c92f5ff1a8b90d84
      922be57d
  2. 07 May, 2015 1 commit
  3. 17 Apr, 2015 1 commit
    • Stephen Smalley's avatar
      libselinux: is_selinux_enabled(): drop no-policy-loaded test. · 801cd604
      Stephen Smalley authored
      upstream commit 685f4aeeadc0b60f3770404d4f149610d656e3c8.
      
      SELinux can be disabled via the selinux=0 kernel parameter or via
      /sys/fs/selinux/disable (triggered by setting SELINUX=disabled in
      /etc/selinux/config).  In either case, selinuxfs will be unmounted
      and unregistered and therefore it is sufficient to check for the
      selinuxfs mount.  We do not need to check for no-policy-loaded and
      treat that as SELinux-disabled anymore; that is a relic of Fedora Core 2
      days.  Drop the no-policy-loaded test, which was a bit of a hack anyway
      (checking whether getcon_raw() returned "kernel" as that can only happen
      if no policy is yet loaded and therefore security_sid_to_context() only
      has the initial SID name available to return as the context).
      
      May possibly fix https://bugzilla.redhat.com/show_bug.cgi?id=1195074
      
      
      by virtue of removing the call to getcon_raw() and therefore avoiding
      use of tls on is_selinux_enabled() calls.  Regardless, it will make
      is_selinux_enabled() faster and simpler.
      
      [sds:  Adapted for the Android libselinux port.  Also drops the
      fallback to scanning /proc/filesystems for selinuxfs as this was
      already done upstream; init mounts selinuxfs via libselinux prior to any
      is_selinux_enabled() checks.  The tls bug is not relevant in Android
      since the Android libselinux port does not use tls, but this change
      is nonetheless useful to optimize is_selinux_enabled().]
      
      Change-Id: Ia8b484a3a2fe7f604b0bfb8f5b109ad7674c1152
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      801cd604
  4. 15 Apr, 2015 1 commit
    • Ying Wang's avatar
      Keep only one host LOCAL_COPY_HEADERS rule. · fab180ea
      Ying Wang authored
      This fixes build warnings:
      build/core/copy_headers.mk:15: warning: overriding commands for target
      `out/host/linux-x86/obj/include/selinux/selinux.h'
      
      Change-Id: Ie64a43856f7fd3759d84a6d3a5b897040cb648f3
      fab180ea
  5. 14 Apr, 2015 2 commits
    • Mark Salyzyn's avatar
      libselinux: create host shared library · 12ea87bb
      Mark Salyzyn authored
      Bug: 19908228
      Change-Id: I618938a5a487d5d9ed8d961f85b4b584f419a1d0
      12ea87bb
    • Nick Kralevich's avatar
      android.c: don't run restorecon on subdirs of /data/data · d601f82e
      Nick Kralevich authored
      /data/data and /data/user are treated differently when doing relabeling.
      Specifically:
      
      1) /data/data should be labeled by init.
      2) files / directories within /data/data should NOT be labeled by init,
         only by installd at system_server's request.
      3) /data/user should be labeled by init.
      4) subdirectories one level deep under /data/user should be labeled
         by init.
      5) subdirectories more than one level deep under /data/user
         should NOT be labeled by init, only by installd at system_server's
         request.
      
      Commit 4766bfa9 inadvertantly applied
      the same rules to /data/data that we use for /data/user, resulting
      in init attempting to label directories one level deep in /data/data.
      Restore the line to the version before 4766bfa9.
      
      While we're here, fix the following compiler warning:
      
        external/libselinux/src/android.c:1059:45: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
        #define EXPAND_USER_PATH "/mnt/expand/????????-????-????-????-????????????/user"
        ^
      
      Bug: 20190506
      Change-Id: I5dc6ada37c2bfd0904e341aabc3b7a123105a212
      d601f82e
  6. 10 Apr, 2015 1 commit
    • Jeff Sharkey's avatar
      Match app directories on expanded storage. · 4766bfa9
      Jeff Sharkey authored
      Expanded storage behaves mostly like the internal data storage,
      including holding private app data.  To correctly apply SELinux
      labels, this change defines a pattern for matching these new paths
      which follow the format:
      
      /mnt/expand/<UUID>/user/<N>
      
      The owner user (0) is not special cased like internal storage, and
      lives under the /user/0 directory.
      
      Bug: 19993667
      Change-Id: Ia3eb28440ff3a119f0a3892e636640cf59c01244
      4766bfa9
  7. 13 Mar, 2015 1 commit
  8. 03 Mar, 2015 2 commits
  9. 24 Feb, 2015 2 commits
  10. 23 Feb, 2015 6 commits
  11. 20 Feb, 2015 3 commits
  12. 19 Feb, 2015 4 commits
    • Bill Yi's avatar
      Merge commit '96869b33' into HEAD · 7b537ae2
      Bill Yi authored
      7b537ae2
    • Stephen Smalley's avatar
      libselinux: Only use /data/security policy if all files are present. · 1e9d2765
      Stephen Smalley authored
      Otherwise if we have a matching selinux_version but only a subset of
      the expected policy files (sepolicy, *_contexts) under /data/security,
      then we'll fail when attempting to open the missing files.
      
      This does not check that mac_permissions.xml is present as that is only
      opened and used by SELinuxMMAC, not by libselinux, but we should likely
      change SELinuxMMAC to do the same.
      
      The alternative would be to change the logic for opening each policy
      file to fall back to the / policy if the /data/security policy is missing,
      as we used to do before the /data/security support was first disabled and
      then reworked to check selinux_version.  Then it would be valid once again
      to merely push a sepolicy file or any other individual file with a
      selinux_version file to /data/security/current without needing to copy
      the rest of the files if they were unchanged.  That is how we used to
      support pushing a policy with dontaudit rules stripped,
      http://seandroid.bitbucket.org/AddressingHiddenDenials.html
      
      
      
      I have updated those instructions to specify that all files must be
      copied but it is a bit more cumbersome to do so.
      
      Change-Id: I60f7ac1f6fa714c0b827a1edd008da172ef1c991
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      1e9d2765
    • Stephen Smalley's avatar
      libselinux: drop sebool= support · 3fb0096a
      Stephen Smalley authored
      
      SELinux policy booleans are prohibited in AOSP, so we can drop the
      support for the sebool= input selector.
      
      Change-Id: I4828cdf1e5370b1dee7d1e887fd7a3d54be2d95d
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      3fb0096a
    • Stephen Smalley's avatar
      libselinux: fix policy reload logic · 818815ed
      Stephen Smalley authored
      
      I5d6d6eb7438361bbb072540c96361cef95c83a9e introduced a bug
      in the policy reload logic such that we incorrectly (but harmlessly)
      load policy twice from / on each boot and never load policy from
      /data/security/current even if it is present.
      
      Also, even prior to that change, we were failing to reload policy
      from / if we previously had loaded a policy from /data/security/current
      and that policy was removed.
      
      Fix the bugs.  Also correct the comments to drop the obsolete
      reference to safe mode and to reflect the updated code.
      
      Change-Id: I7b53c91c5681764009de453ff104a72cd26d7c2e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      818815ed
  13. 02 Feb, 2015 15 commits