Skip to content
Snippets Groups Projects
  1. Apr 13, 2018
    • Jaekyun Seok's avatar
      Whitelist vendor-init-settable bluetooth_prop and wifi_prop · a11b16c9
      Jaekyun Seok authored
      Values of the following properties are set by SoC vendors on some
      devices including Pixels.
      - persist.bluetooth.a2dp_offload.cap
      - persist.bluetooth.a2dp_offload.enable
      - persist.vendor.bluetooth.a2dp_offload.enable
      - ro.bt.bdaddr_path
      - wlan.driver.status
      
      So they should be whitelisted for compatibility.
      
      Bug: 77633703
      Test: succeeded building and tested with Pixels
      Change-Id: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
      Merged-In: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
      (cherry picked from commit 224921d1)
      a11b16c9
    • Jaekyun Seok's avatar
      Whitelist vendor-init-settable bluetooth_prop and wifi_prop · 224921d1
      Jaekyun Seok authored
      Values of the following properties are set by SoC vendors on some
      devices including Pixels.
      - persist.bluetooth.a2dp_offload.cap
      - persist.bluetooth.a2dp_offload.enable
      - persist.vendor.bluetooth.a2dp_offload.enable
      - ro.bt.bdaddr_path
      - wlan.driver.status
      
      So they should be whitelisted for compatibility.
      
      Bug: 77633703
      Test: succeeded building and tested with Pixels
      Change-Id: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
      224921d1
  2. 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
  3. Apr 05, 2018
  4. Apr 04, 2018
  5. Apr 03, 2018
    • Jeff Vander Stoep's avatar
      Rename qtaguid_proc to conform to name conventions · bdf2a9c4
      Jeff Vander Stoep authored
      Test: build
      Bug: 68774956
      Change-Id: I0f9fd87eb41e67e14f35e49eba13e3d1de745250
      bdf2a9c4
    • Chenbo Feng's avatar
      Block SDK 28 app from using proc/net/xt_qtaguid · c411ff70
      Chenbo Feng authored
      The file under /proc/net/xt_qtaguid is going away in future release.
      Apps should use the provided public api instead of directly reading the
      proc file. This change will block apps that based on SDK 28 or above to
      directly read that file and we will delete that file after apps move
      away from it.
      
      Test: Flashed with master branch on marlin, verified phone boot, can
            browse web, watch youtube video, make phone call and use google
            map for navigation with wifi on and off.
            run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
            run cts -m CtsAppSecurityHostTestCases -t \
            		android.appsecurity.cts.AppSecurityTests
      
      Change-Id: I4c4d6c9ab28b426acef23db53f171de8f20be1dc
      (cherry picked from commit 5ec8f843)
      c411ff70
    • Jeff Vander Stoep's avatar
      Rename qtaguid_proc to conform to name conventions · 27b32ac6
      Jeff Vander Stoep authored
      Test: build
      Bug: 68774956
      Change-Id: I0f9fd87eb41e67e14f35e49eba13e3d1de745250
      (cherry picked from commit 5f650f581a2699bb2d5aaaa4675d651eb47c1c16)
      27b32ac6
  6. Mar 29, 2018
  7. Feb 09, 2018
    • Chenbo Feng's avatar
      Block SDK 28 app from using proc/net/xt_qtaguid · 5ec8f843
      Chenbo Feng authored
      The file under /proc/net/xt_qtaguid is going away in future release.
      Apps should use the provided public api instead of directly reading the
      proc file. This change will block apps that based on SDK 28 or above to
      directly read that file and we will delete that file after apps move
      away from it.
      
      Test: Flashed with master branch on marlin, verified phone boot, can
            browse web, watch youtube video, make phone call and use google
            map for navigation with wifi on and off.
            run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
            run cts -m CtsAppSecurityHostTestCases -t \
            		android.appsecurity.cts.AppSecurityTests
      
      Change-Id: I4c4d6c9ab28b426acef23db53f171de8f20be1dc
      5ec8f843
  8. Feb 06, 2018
  9. Jan 30, 2018
    • Chenbo Feng's avatar
      Remove app access to qtaguid ctrl/stats file · fad0b04d
      Chenbo Feng authored
      Remove the untrusted apps and priviledged apps from the group that can
      directly access xt_qtaguid module related file. All apps that need to
      access app network usage data need to use the public API provided in
      framework.
      
      Test: Flashed with master branch on marlin, verified phone boot, can
            browse web, watch youtube video, make phone call and use google
            map for navigation with either wifi is on or off.
            run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
            run cts -m CtsNativeNetTestCases
      Bug: 68774956 30950746
      
      Change-Id: I9b3db819d6622611d5b512ef821abb4c28d6c9eb
      fad0b04d
  10. Jan 24, 2018
    • Marissa Wall's avatar
      sepolicy: restrict access to uid_cpupower files · dfe063c3
      Marissa Wall authored
      Do not let apps read /proc/uid_cpupower/time_in_state,
      /proc/uid_cpupower/concurrent_active_time,
      /proc/uid_cpupower/concurrent_policy_time.
      
      b/71718257
      
      Test: Check that they can't be read from the shell
          without root permissions and system_server was able
          to read them
      
      Change-Id: I812694adfbb4630f7b56aa7096dc2e6dfb148b15
      dfe063c3
  11. Jan 11, 2018
    • Jeff Vander Stoep's avatar
      relabel files in /proc/net/xt_qtaguid/ · 43303c8b
      Jeff Vander Stoep authored
      /proc/net/xt_qtaguid is used by apps to track their network data
      use. Limit access to just zygote spawned processes - apps and
      system_server, omitting access to isolated_app which is not allowed
      to create network sockets.
      As Android moves to eBPF for app's network data stats, access to
      /proc/net/xt_qtaguid will be removed entirely. Segmenting access off
      is the first step.
      Bug: 68774956
      
      This change also helps further segment and whitelist access to
      files in /proc/net and is a step in the lockdown of /proc/net.
      Bug: 9496886
      
      Test: boot Taimen. Walk through setup-wizard. Make phone call and
          video call. Browse web. Watch youtube. Navigate in maps.
      Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t \
          android.appsecurity.cts.AppSecurityTests
      Test: cts-tradefed run cts -m CtsNativeNetTestCases
      Test: cts-tradefed run cts -m CtsIncidentHostTestCases -t \
          com.android.server.cts.NetstatsIncidentTest
      Test: cts-tradefed run cts -m CtsOsTestCases -t \
          android.os.cts.StrictModeTest
      Test: cts-tradefed run cts -m CtsNetTestCases -t \
          android.net.cts.TrafficStatsTest
      Test: cts-tradefed run cts -m CtsUsageStatsTestCases -t \
          android.app.usage.cts.NetworkUsageStatsTest
      Test: vts-tradefed run vts -m VtsQtaguidTest
      Change-Id: Idddd318c56b84564142d37b11dcc225a2f2800ea
      43303c8b
  12. Dec 22, 2017
  13. Dec 20, 2017
    • Jeff Vander Stoep's avatar
      app: move appdomain to public policy · 77b290f3
      Jeff Vander Stoep authored
      Vendor-specific app domains depend on the rules in app.te so they
      must reside in public policy.
      
      Bug: 70517907
      Test: build
      Change-Id: If45557a5732a06f78c752779a8182e053beb25a2
      Merged-In: If45557a5732a06f78c752779a8182e053beb25a2
      (cherry picked from commit 1f4cab8b)
      77b290f3
  14. Dec 19, 2017
    • Jeff Vander Stoep's avatar
      app: move appdomain to public policy · 1f4cab8b
      Jeff Vander Stoep authored
      Vendor-specific app domains depend on the rules in app.te so they
      must reside in public policy.
      
      Bug: 70517907
      Test: build
      Change-Id: If45557a5732a06f78c752779a8182e053beb25a2
      1f4cab8b
  15. Dec 16, 2017
    • Jeff Vander Stoep's avatar
      Audit app access to /proc/net/* · 84f96859
      Jeff Vander Stoep authored
      Many processes including third party apps are expected to
      access /proc/net/xt_qtaguid/stats. Give this file a new label
      to avoid spamming the logs and temporarily grant read access to
      all processes.
      
      Read-only permission is adequate for all processes based on unix
      permissions.
      sailfish:/ # ls -laZ /proc/net/xt_qtaguid/stats
      -r--r--r--  1 root net_bw_stats u:object_r:proc_net_xt_qtaguid_stats:s0 stats
      
      Bug: 9496886
      Bug: 68016944
      Bug: 70722355
      Test: Build/flash Sailfish. Browse in Chrome and watch videos in youtube.
          No "denied" or "granted" selinux messages observed in the logs.
      
      Change-Id: I29f1ee806c8149988b9b93a950790d14754927ef
      84f96859
  16. Dec 12, 2017
    • Marissa Wall's avatar
      Restrict access to uid_concurrent_*_time · 80ee23f7
      Marissa Wall authored
      Do not let apps read uid_concurrent_active_time and
      uid_concurrent_policy_time.
      
      b/68399339
      
      Test: Check that they can't be read from the shell
          without root permissions and system_server was able
          to read them
      
      Change-Id: I6f09ef608607cb9f4084ba403a1e7254b8c49a06
      80ee23f7
  17. 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
  18. Sep 26, 2017
  19. Sep 18, 2017
  20. Sep 05, 2017
  21. Sep 01, 2017
  22. Aug 14, 2017
    • Steven Moreland's avatar
      Add screencap domain. · 9216a6ad
      Steven Moreland authored
      Only seeing this denial in permissive:
      allow shell screencap_exec:file getattr;
      
      Bug: 37565047
      Test: adb shell screencap w/o root
      Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases
      Merged-In: I9f31d2067e002e7042646ee38dbfc06687481ac7
      Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
      9216a6ad
    • Steven Moreland's avatar
      Add screencap domain. · 6b780b35
      Steven Moreland authored
      Only seeing this denial in permissive:
      allow shell screencap_exec:file getattr;
      
      Bug: 37565047
      Test: adb shell screencap w/o root
      Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases
      Merged-In: I9f31d2067e002e7042646ee38dbfc06687481ac7
      Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
      6b780b35
  23. Aug 11, 2017
    • Nick Kralevich's avatar
      Validate no-cross-domain /proc/PID access · 7a463809
      Nick Kralevich authored
      Android uses hidepid=2 to restrict visibility to other /proc entries on
      the system. This helps preserve user, application, and system
      confidentiality by preventing unauthorized access to application metadata,
      and addresses attacks such as
      http://www.cs.ucr.edu/~zhiyunq/pub/sec14_android_activity_inference.pdf
      
      Ensure the SELinux (weaker) equivalent is being enforced by adding
      neverallow compile time assertions.
      
      TODO: The "shell" user runs as both an Android application, as well as
      spawned via adb shell. This was a mistake. We should separate out the
      "shell" Android app into it's own SELinux domain. For now, exclude the
      shell from this assertion. (The shell Android app is covered by
      hidepid=2, so there's no leaking of data, but still, it's over
      privileged today and should be cleaned up.
      
      Bug: 23310674
      Test: policy compiles. Compile time assertion only.
      Change-Id: I0e1a6506b2719aabf7eb8127f046c4ada947ba90
      7a463809
    • Steven Moreland's avatar
      Add screencap domain. · f27bba93
      Steven Moreland authored
      Only seeing this denial in permissive:
      allow shell screencap_exec:file getattr;
      
      Bug: 37565047
      Test: adb shell screencap w/o root
      Test: cts-tradefed run cts-dev --module CtsAadbHostTestCases
      Change-Id: I9f31d2067e002e7042646ee38dbfc06687481ac7
      f27bba93
  24. Jul 28, 2017
    • Philip P. Moltmann's avatar
      Allow untrusted apps to read apks · bdac15aa
      Philip P. Moltmann authored
      Bug: 37281396
      Test: cts-tradefed run cts-dev -m CtsContentTestCases --test=android.content.pm.cts.InstallSessionTransferTest
      Change-Id: If2094057d1acfbbf007ae108225decd9ad70e459
      bdac15aa
  25. Jul 13, 2017
    • Andreas Gampe's avatar
      App: Allow wrapped app to send pid · 3a5abb3b
      Andreas Gampe authored
      Allow wrapped app to send pid back to zygote.
      
      (cherry picked from commit ee694980)
      
      Bug: 63566721
      Bug: 63635227
      Test: lunch angler-userdebug && m
      Test: lunch angler-user && m
      Test: lunch angler-user && m && fastboot flashall && m cts && cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases
      Change-Id: Ie1b41c3eb124aa5ee321c124d0121a0e965f0f0e
      3a5abb3b
    • Andreas Gampe's avatar
      App: Allow wrapped app to send pid · ee694980
      Andreas Gampe authored
      Allow wrapped app to send pid back to zygote.
      
      Bug: 63566721
      Bug: 63635227
      Test: lunch angler-userdebug && m
      Test: lunch angler-user && m
      Test: lunch angler-user && m && fastboot flashall && m cts && cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases
      Change-Id: Ie1b41c3eb124aa5ee321c124d0121a0e965f0f0e
      ee694980
  26. Jun 23, 2017
    • Jeff Vander Stoep's avatar
      system_server is a client of configstore · 23e0a7f2
      Jeff Vander Stoep authored
      avc:  denied  { find } for
      interface=android.hardware.configstore::ISurfaceFlingerConfigs
      scontext=u:r:system_server:s0
      tcontext=u:object_r:hal_configstore_ISurfaceFlingerConfigs:s0
      tclass=hwservice_manager permissive=0
      
      Bug: 35197529
      Test: Device boots without this denial
      Change-Id: Ia43bc5879e03a1f2056e373b17cc6533636f98b1
      23e0a7f2
    • Narayan Kamath's avatar
      DO NOT MERGE ANYWHERE Revert "SEPolicy: Changes for new stack dumping scheme." · 034f5840
      Narayan Kamath authored
      NOTE: This change is marked dnma because we don't want it on
      oc-dr1-dev-plus-aosp or any other downstream branch. Moreover,
      oc-dr1-dev-plus-aosp is the only outgoing merger from oc-dr1-dev for
      this project.
      
      This reverts commit 11bfcc1e.
      
      Bug: 62908344
      Test: make
      Change-Id: Ide61829cf99f15777c46f657a0e140d594f88243
      034f5840
  27. Jun 22, 2017
    • Daniel Rosenberg's avatar
      Add rules for vfat for sdcardfs · 8a65aeca
      Daniel Rosenberg authored
      
      This adds parellel rules to the ones added for media_rw_data_file
      to allow apps to access vfat under sdcardfs. This should be reverted
      if sdcardfs is modified to alter the secontext it used for access to
      the lower filesystem
      
      Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65
      Bug: 62584229
      Test: Run android.appsecurity.cts.ExternalStorageHostTest with
            an external card formated as vfat
      Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
      8a65aeca
  28. Jun 16, 2017
    • Daniel Rosenberg's avatar
      Add rules for vfat for sdcardfs · 260a4485
      Daniel Rosenberg authored
      
      This adds parellel rules to the ones added for media_rw_data_file
      to allow apps to access vfat under sdcardfs. This should be reverted
      if sdcardfs is modified to alter the secontext it used for access to
      the lower filesystem
      
      Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65
      Bug: 62584229
      Test: Run android.appsecurity.cts.ExternalStorageHostTest with
            an external card formated as vfat
      Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
      260a4485
  29. May 31, 2017
    • Narayan Kamath's avatar
      SEPolicy: Allow app / system_server to write to dumpstate pipes. · a34781ae
      Narayan Kamath authored
      tombstoned allows dumpstate to install "intercepts" to java trace
      requests for a given process. When an "intercept" is installed, all
      trace output is redirected to a pipe provided by dumpstate instead
      of the default location (usually in /data/anr or /data/tombstone).
      
      Note that these processes are already granted "write" and "getattr"
      on dumpstate:fifo_file in order to communicate with dumpstate; this
      change adds "append" to the existing set of permissions.
      
      Bug: 32064548
      Test: manual
      Change-Id: Iccbd78c59071252fef318589f3e55ece51a3c64c
      a34781ae
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · f194aad2
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709)
      
      (cherry picked from commit 11bfcc1e)
      
      Change-Id: Icc60d227331c8eee70a9389ff1e7e78772f37e6f
      f194aad2
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · e628cb5b
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      Merged-In: I70a3e6e230268d12b454e849fa88418082269c4f
      Change-Id: Ib4b73fc130f4993c44d96c8d68f61b6d9bb2c7d5
      e628cb5b
Loading