Skip to content
Snippets Groups Projects
  1. Apr 10, 2018
    • Jeff Vander Stoep's avatar
      Start the process of locking down proc/net · 08731895
      Jeff Vander Stoep authored
      Files in /proc/net leak information. This change is the first step in
      determining which files apps may use, whitelisting benign access, and
      otherwise removing access while providing safe alternative APIs.
      
      To that end, this change:
      * Introduces the proc_net_type attribute which will assigned to any
      new SELinux types in /proc/net to avoid removing access to privileged
      processes. These processes may be evaluated later, but are lower
      priority than apps.
      * Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing
      use by VPN apps. This may be replaced by an alternative API.
      * Audits all other proc/net access for apps.
      * Audits proc/net access for other processes which are currently
      granted broad read access to /proc/net but should not be including
      storaged, zygote, clatd, logd, preopt2cachename and vold.
      
      Bug: 9496886
      Bug: 68016944
      Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube
          navigate maps, send text message, make voice call, make video call.
          Verify no avc "granted" messages in the logs.
      Test: A few VPN apps including "VPN Monster", "Turbo VPN", and
      "Freighter". Verify no logspam with the current setup.
      Test: atest CtsNativeNetTestCases
      Test: atest netd_integration_test
      Test: atest QtaguidPermissionTest
      Test: atest FileSystemPermissionTest
      
      Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457
      08731895
  2. Mar 08, 2018
    • Joel Galenson's avatar
      Ensure taking a bugreport generates no denials. · ba0c279d
      Joel Galenson authored
      This commit adds new SELinux permissions and neverallow rules so that
      taking a bugreport does not produce any denials.
      
      Bug: 73256908
      Test: Captured bugreports on Sailfish and Walleye and verified
      that there were no denials.
      
      Merged-In: If3f2093a2b51934938e3d7e5c42036b2e2bf6de9
      Change-Id: If3f2093a2b51934938e3d7e5c42036b2e2bf6de9
      (cherry picked from commit daf1cdfa)
      ba0c279d
  3. Mar 05, 2018
    • Joel Galenson's avatar
      Ensure taking a bugreport generates no denials. · 03ff9f91
      Joel Galenson authored
      This commit adds new SELinux permissions and neverallow rules so that
      taking a bugreport does not produce any denials.
      
      Bug: 73256908
      Test: Captured bugreports on Sailfish and Walleye and verified
      that there were no denials.
      
      Merged-In: If3f2093a2b51934938e3d7e5c42036b2e2bf6de9
      Change-Id: I10882e7adda0bb51bf373e0e62fda0acc8ad34eb
      03ff9f91
  4. Mar 02, 2018
    • Joel Galenson's avatar
      Ensure taking a bugreport generates no denials. · daf1cdfa
      Joel Galenson authored
      This commit adds new SELinux permissions and neverallow rules so that
      taking a bugreport does not produce any denials.
      
      Bug: 73256908
      Test: Captured bugreports on Sailfish and Walleye and verified
      that there were no denials.
      
      Change-Id: If3f2093a2b51934938e3d7e5c42036b2e2bf6de9
      daf1cdfa
  5. Jan 17, 2018
  6. Nov 21, 2017
    • Benjamin Gordon's avatar
      sepolicy: Add rules for non-init namespaces · 9b2e0cbe
      Benjamin Gordon authored
      In kernel 4.7, the capability and capability2 classes were split apart
      from cap_userns and cap2_userns (see kernel commit
      8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
      run in a container with SELinux in enforcing mode.
      
      This change applies the existing capability rules to user namespaces as
      well as the root namespace so that Android running in a container
      behaves the same on pre- and post-4.7 kernels.
      
      This is essentially:
        1. New global_capability_class_set and global_capability2_class_set
           that match capability+cap_userns and capability2+cap2_userns,
           respectively.
        2. s/self:capability/self:global_capability_class_set/g
        3. s/self:capability2/self:global_capability2_class_set/g
        4. Add cap_userns and cap2_userns to the existing capability_class_set
           so that it covers all capabilities.  This set was used by several
           neverallow and dontaudit rules, and I confirmed that the new
           classes are still appropriate.
      
      Test: diff new policy against old and confirm that all new rules add
            only cap_userns or cap2_userns;
            Boot ARC++ on a device with the 4.12 kernel.
      Bug: crbug.com/754831
      
      Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
      9b2e0cbe
  7. Oct 17, 2017
    • Yifan Hong's avatar
      healthd provides health@2.0 service. · b9aa0100
      Yifan Hong authored
      * remove binder calls to healthd (storaged, system_server)
      * Allow healthd to serve health HAL
      
      Bug: 62229583
      Test: no health related denials
      Test: VTS health test
      Test: BatteryManagerTest
      
      Change-Id: I0cf1872c0ba69e7de7c3f529d548f9ffe39812ac
      b9aa0100
  8. Sep 28, 2017
  9. Sep 26, 2017
  10. Aug 15, 2017
  11. Aug 04, 2017
    • Todd Kennedy's avatar
      Allow PackageManager to create a new service · 8bb80471
      Todd Kennedy authored
      A new API [getNamesForUids] was recently added to the PackageManager
      and this API needs to be accessible to native code. However, there
      were two constraints:
      1) Instead of hand-rolling the binder, we wanted to auto generate
      the bindings directly from the AIDL compiler.
      2) We didn't want to expose/annotate all 180+ PackageManager APIs
      when only a single API is needed.
      So, we chose to create a parallel API that can be used explicitly
      for native bindings without exposing the entirety of the
      PackageManager.
      
      Bug: 62805090
      Test: Manual
      Test: Create a native application that calls into the new service
      Test: See the call works and data and returned
      Change-Id: I0d469854eeddfa1a4fd04b5c53b7a71ba3ab1f41
      8bb80471
  12. May 03, 2017
    • William Roberts's avatar
      storaged: add permissions for dumpstate · fd8f305b
      William Roberts authored
      
      The service "storaged" implememnts a dump() interface for
      dumpsys, and thus it needs to write its state to the fd
      provided by dumpstate.
      
      To correct this, and fix dumpstate, allow the permission.
      
      Fixes:
      avc: denied { use } for pid=3298 comm="dumpsys" path="pipe:[33470]" dev="pipefs" ino=33470 scontext=u:r:storaged:s0 tcontext=u:r:dumpstate:s0 tclass=fd permissive=0
      
      Test:
      With a device that has storaged, issue the command:
      $ adb shell dumpstate
      
      Change-Id: I515e20f0328b6edc01ea2a7c53b1d3c4ca0e72ac
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      fd8f305b
  13. Apr 13, 2017
  14. Mar 31, 2017
  15. Mar 30, 2017
  16. Mar 24, 2017
    • Alex Klyubin's avatar
      Vendor domains must not use Binder · f5446eb1
      Alex Klyubin authored
      On PRODUCT_FULL_TREBLE devices, non-vendor domains (except vendor
      apps) are not permitted to use Binder. This commit thus:
      * groups non-vendor domains using the new "coredomain" attribute,
      * adds neverallow rules restricting Binder use to coredomain and
        appdomain only, and
      * temporarily exempts the domains which are currently violating this
        rule from this restriction. These domains are grouped using the new
        "binder_in_vendor_violators" attribute. The attribute is needed
        because the types corresponding to violators are not exposed to the
        public policy where the neverallow rules are.
      
      Test: mmm system/sepolicy
      Test: Device boots, no new denials
      Test: In Chrome, navigate to ip6.me, play a YouTube video
      Test: YouTube: play a video
      Test: Netflix: play a movie
      Test: Google Camera: take a photo, take an HDR+ photo, record video with
            sound, record slow motion video with sound. Confirm videos play
            back fine and with sound.
      Bug: 35870313
      Change-Id: I0cd1a80b60bcbde358ce0f7a47b90f4435a45c95
      f5446eb1
  17. Feb 27, 2017
  18. Feb 06, 2017
  19. Jan 26, 2017
    • William Roberts's avatar
      te_macros: introduce add_service() macro · 606d2fd6
      William Roberts authored
      
      Introduce the add_service() macro which wraps up add/find
      permissions for the source domain with a neverallow preventing
      others from adding it. Only a particular domain should
      add a particular service.
      
      Use the add_service() macro to automatically add a neverallow
      that prevents other domains from adding the service.
      
      mediadrmserver was adding services labeled mediaserver_service.
      Drop the add permission as it should just need the find
      permission.
      
      Additionally, the macro adds the { add find } permission which
      causes some existing neverallow's to assert. Adjust those
      neverallow's so "self" can always find.
      
      Test: compile and run on hikey and emulator. No new denials were
      found, and all services, where applicable, seem to be running OK.
      
      Change-Id: Ibbd2a5304edd5f8b877bc86852b0694732be993c
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      606d2fd6
  20. Jan 21, 2017
    • Jin Qian's avatar
      storaged: allow reading packages.list · 8ad57ef6
      Jin Qian authored
      Delete rule for permission_service since we use packages.list instead.
      
      Test: adb shell storaged -u
      Bug: 34198239
      Change-Id: Ic69d0fe185e627a932bbf8e85fc13163077bbe6b
      8ad57ef6
  21. Jan 18, 2017
    • Jin Qian's avatar
      Define policy for /proc/uid_io/stats · d345906b
      Jin Qian authored
      New procfs file read by storaged to dump fg/bg IO usage.
      
      Remove kmsg rule since it's no longer used by storaged.
      
      Allow storaged to find permission_service to translate UID
      to package name.
      
      Test: adb shell storaged -u
      Bug: 34198239
      Change-Id: I74654662c75571cbe166cf2b8cbab84828218cbd
      d345906b
  22. Jan 07, 2017
    • Nick Kralevich's avatar
      storaged.te: Remove redundant permission. · 1a022cbb
      Nick Kralevich authored
      All SELinux domains are already granted the ability to read the
      filenames in /proc, so it's unnecessary to add it to storaged.te.
      
        $ grep "proc:dir r_dir_perms" public/domain.te
        allow domain proc:dir r_dir_perms;
      
      Remove redundant rule.
      
      Test: policy compiles.
      Change-Id: I8779cda19176f7eb914778f131bb5b14e5b14448
      1a022cbb
    • ynwang's avatar
      Storaged permissions for task I/O · e68d2d2c
      ynwang authored
      Allow storaged to read /proc/[pid]/io
      Grant binder access to storaged
      Add storaged service
      Grant storaged_exec access to dumpstate
      Grant storaged binder_call to dumpstate
      
      Bug: 32221677
      
      Change-Id: Iecc9dba266c5566817a99ac6251eb943a0bac630
      e68d2d2c
    • ynwang's avatar
      Storaged permission setting · 9fa8823c
      ynwang authored
      Allowing storaged for reading from pseudo filesystems and debugfs.
      
      Bug: 32221677
      
      Change-Id: I837cead9a68f0b399703b64d724cb9c4b205c335
      9fa8823c
Loading