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 03, 2018
    • Nathan Harold's avatar
      Allow getsockopt and setsockopt for Encap Sockets · 252b0153
      Nathan Harold authored
      Because applications should be able to set the receive
      timeout on UDP encapsulation sockets, we need to allow
      setsockopt(). getsockopt() is an obvious allowance as
      well.
      
      Bug: 68689438
      Test: compilation
      Merged-In: I2eaf72bcce5695f1aee7a95ec03111eca577651c
      Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
      252b0153
    • Nathan Harold's avatar
      Allow getsockopt and setsockopt for Encap Sockets · ea4eaaf1
      Nathan Harold authored
      Because applications should be able to set the receive
      timeout on UDP encapsulation sockets, we need to allow
      setsockopt(). getsockopt() is an obvious allowance as
      well.
      
      Bug: 68689438
      Test: compilation
      Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
      ea4eaaf1
  4. Feb 13, 2018
    • Bookatz's avatar
      Statsd allow shell in selinux policy · 022ab0e7
      Bookatz authored
      CTS tests need to be able to call, from hostside:
      adb shell cmd stats dump-report (and others)
      On a user build, this will fail because of an selinux policy violation
      from shell. This cl fixes this by granting shell permission.
      
      Similarly, Settings needs to communicate with statsd, so
      system_app-statsd binder calls are given permission.
      
      Bug: 72961153
      Bug: 73255014
      Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests
      Test: manual confirmation
      Change-Id: I6589ab4ef5c91a4a7f78eb97b63d9bb43e3d8f02
      022ab0e7
  5. Jan 20, 2018
  6. Jan 18, 2018
    • Pavel Grafov's avatar
      Allow system apps to read log props. · 118e4969
      Pavel Grafov authored
      This is needed to allow system apps to know whether security
      logging is enabled, so that they can in this case log additional
      audit events.
      
      Test: logged a security event from locally modified KeyChain app.
      Bug: 70886042
      Change-Id: I9e18d59d72f40510f81d1840e4ac76a654cf6cbd
      118e4969
  7. Jan 15, 2018
    • Nathan Harold's avatar
      Allow More Apps to Recv UDP Sockets from SystemServer · ee268643
      Nathan Harold authored
      This gives the privilege to system apps, platform apps,
      ephemeral apps, and privileged apps to receive a
      UDP socket from the system server. This is being added
      for supporting UDP Encapsulation sockets for IPsec, which
      must be provided by the system.
      
      This is an analogous change to a previous change that
      permitted these sockets for untrusted_apps:
      0f75a62e
      
      Bug: 70389346
      Test: IpSecManagerTest, System app verified with SL4A
      Change-Id: Iec07e97012e0eab92a95fae9818f80f183325c31
      ee268643
  8. Jan 10, 2018
    • Jaekyun Seok's avatar
      Whitelist exported platform properties · e4971454
      Jaekyun Seok authored
      This CL lists all the exported platform properties in
      private/exported_property_contexts.
      
      Additionally accessing core_property_type from vendor components is
      restricted.
      Instead public_readable_property_type is used to allow vendor components
      to read exported platform properties, and accessibility from
      vendor_init is also specified explicitly.
      
      Note that whitelisting would be applied only if
      PRODUCT_COMPATIBLE_PROPERTY is set on.
      
      Bug: 38146102
      Test: tested on walleye with PRODUCT_COMPATIBLE_PROPERTY=true
      Change-Id: I304ba428cc4ca82668fec2ddeb17c971e7ec065e
      e4971454
  9. Oct 13, 2017
  10. Sep 28, 2017
  11. Sep 27, 2017
    • Jeff Vander Stoep's avatar
      Allow system settings to read /proc/version · c975bd90
      Jeff Vander Stoep authored
      Used to display kernel version in settings app.
      
      avc: denied { read } for name="version" dev="proc"
      scontext=u:r:system_app:s0 tcontext=u:object_r:proc_version:s0
      tclass=file permissive=0
      
      Bug: 66985744
      Test: kernel version now displayed in settings app.
      Change-Id: I53f92f63362b900347fd393a40d70ccf5d220d30
      c975bd90
  12. Sep 26, 2017
  13. Sep 06, 2017
    • Jeff Sharkey's avatar
      Start paving the way for vold calls over Binder. · 0fa3fb02
      Jeff Sharkey authored
      This change is the bare minimum needed to publish a new vold
      Binder service and move the simple "reset" call over to go through
      the new interface.
      
      The new rules here are mirrored on the existing installd rules, but
      with a handful of neverallow rules relaxed due to funky interactions
      with hal_client_domain().
      
      Test: builds, boots
      Bug: 13758960
      Change-Id: Ia9522ea7a68698cb0edce7879abfbf22b9d67c76
      0fa3fb02
  14. Jul 28, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecated is dead · b5da252e
      Jeff Vander Stoep authored
      long live domain.te!
      
      Remove all references.
      
      Bug: 28760354
      Test: build
      Merged-In: I99953ecc7d275fdbe8e56d8f47a27d1f9e1cc09a
      Change-Id: I99953ecc7d275fdbe8e56d8f47a27d1f9e1cc09a
      b5da252e
    • Jeff Vander Stoep's avatar
      domain_deprecated is dead · c3d8ca71
      Jeff Vander Stoep authored
      long live domain.te!
      
      Remove all references.
      
      Bug: 28760354
      Test: build
      Change-Id: I99953ecc7d275fdbe8e56d8f47a27d1f9e1cc09a
      (cherry picked from commit b8d14dc9a6b1593c4ad5210f3079bcac3a9aea33)
      c3d8ca71
  15. Jul 26, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove proc access · c15d54ef
      Jeff Vander Stoep authored
      Remove "granted" logspam. Grante the observed permissions to the
      individual processes that need them and remove the permission from
      domain_deprecated.
      
      avc: granted { read open } for comm="ndroid.settings"
      path="/proc/version" dev="proc" ino=4026532081
      scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { getattr } for comm=4173796E635461736B202332
      path="/proc/pagetypeinfo" dev="proc" ino=4026532129
      scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="uncrypt" path="/proc/cmdline"
      dev="proc" ino=4026532072 scontext=u:r:uncrypt:s0
      tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="update_engine"
      path="/proc/sys/kernel/random/boot_id" dev="proc" ino=15852829
      scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      avc: granted { read open } for comm="tiveportallogin"
      path="/proc/vmstat" dev="proc" ino=4026532130
      scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:proc:s0
      tclass=file
      
      This change is specifically not granting the following since it
      should not be allowed:
      avc: granted { read open } for comm="crash_dump64"
      path="/proc/filesystems" dev="proc" ino=4026532416
      scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read } for comm="crash_dump64" name="filesystems"
      dev="proc" ino=4026532416 scontext=u:r:dex2oat:s0
      tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { getattr } for comm="crash_dump64"
      path="/proc/filesystems" dev="proc" ino=4026532416
      scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Bug: 64032843
      Bug: 28760354
      Test: build
      Change-Id: Ib309e97b6229bdf013468dca34f606c0e8da96d0
      c15d54ef
  16. Jul 11, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove rootfs access · a12aad45
      Jeff Vander Stoep authored
      Grant audited permissions collected in logs.
      
      tcontext=platform_app
      avc: granted { getattr } for comm=496E666C6174657254687265616420
      path="/" dev="dm-0" ino=2 scontext=u:r:platform_app:s0:c512,c768
      tcontext=u:object_r:rootfs:s0 tclass=dir
      
      tcontext=system_app
      avc: granted { getattr } for comm="android:ui" path="/" dev="dm-0"
      scontext=u:r:system_app:s0 tcontext=u:object_r:rootfs:s0 tclass=dir
      avc: granted { getattr } for comm="android:ui" path="/" dev="dm-0"
      scontext=u:r:system_app:s0 tcontext=u:object_r:rootfs:s0 tclass=dir
      
      tcontext=update_engine
      avc: granted { getattr } for comm="update_engine" path="/" dev="dm-0"
      ino=2 scontext=u:r:update_engine:s0 tcontext=u:object_r:rootfs:s0
      tclass=dir
      avc: granted { getattr } for comm="update_engine" path="/fstab.foo"
      dev="dm-0" ino=25 scontext=u:r:update_engine:s0
      tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read open } for comm="update_engine" path="/fstab.foo"
      dev="dm-0" ino=25 scontext=u:r:update_engine:s0
      tcontext=u:object_r:rootfs:s0 tclass=file
      
      Bug: 28760354
      Test: build
      Change-Id: I6135eea1d10b903a4a7e69da468097f495484665
      a12aad45
  17. Apr 26, 2017
    • Nick Kralevich's avatar
      relax fuse_device neverallow rules · 45766d41
      Nick Kralevich authored
      The fuse_device neverallow rules are too aggressive and are inhibiting
      certain vendor customizations. Relax the /dev/fuse neverallow rules so
      that they better reflect the security invariants we want to uphold.
      
      Bug: 37496487
      Test: policy compiles.
      Change-Id: Ie73b0ba7c76446afc2a7a23ebed1275c977d932d
      45766d41
  18. Apr 04, 2017
  19. Mar 31, 2017
    • Daniel Nicoara's avatar
      VR: Add sepolicy for VR HWC service · 6907e39a
      Daniel Nicoara authored
      VR HWC is being split out of VR Window Manager. It creates a HW binder
      interface used by SurfaceFlinger which implements the HWComposer HAL and
      a regular binder interface which will be used by a system app to receive
      the SurfaceFlinger output.
      
      Bug: b/36051907
      Test: Ran in permissive mode and ensured no permission errors show in
      logcat.
      
      Change-Id: If1360bc8fa339a80100124c4e89e69c64b29d2ae
      6907e39a
  20. 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
  21. Feb 15, 2017
    • Alex Vakulenko's avatar
      Add SELinux policies for vr_window_manager · c5680561
      Alex Vakulenko authored
      This set of rules is neeeded to allow vr_windows_manager to run
      successfully on the system.
      
      Bug: 32541196
      Test: `m -j32` succeeds. Sailfish device boots.
      Change-Id: I0aec94d80f655a6f47691cf2622dd158ce9e475f
      c5680561
  22. Feb 07, 2017
  23. Jan 31, 2017
    • Mark Salyzyn's avatar
      logd: restrict access to /dev/event-log-tags · d33a9a19
      Mark Salyzyn authored
      Create an event_log_tags_file label and use it for
      /dev/event-log-tags.  Only trusted system log readers are allowed
      direct read access to this file, no write access.  Untrusted domain
      requests lack direct access, and are thus checked for credentials via
      the "plan b" long path socket to the event log tag service.
      
      Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
      Bug: 31456426
      Bug: 30566487
      Change-Id: Ib9b71ca225d4436d764c9bc340ff7b1c9c252a9e
      d33a9a19
  24. Jan 26, 2017
    • Steven Moreland's avatar
      property: add persist.hal.binderization · cd597cd5
      Steven Moreland authored
      - Added set_prop to shell so that you can set it from shell.
      - Added set_prop to sytem_app so that it can be updated in settings.
      
      Bug: 34256441
      Test: can update prop from Settings and shell. nfc and lights work with
      ag/1833821 with persist.hal.binderization set to on and off. There are
      no additional selinux denials.
      Change-Id: I883ca489093c1d56b2efa725c58e6e3f3b81c3aa
      cd597cd5
  25. Jan 06, 2017
    • Alex Klyubin's avatar
      Move system_app policy to private · b5853c3b
      Alex Klyubin authored
      This leaves only the existence of system_app domain as public API.
      All other rules are implementation details of this domain's policy and
      are thus now private.
      
      Test: No change to policy according to sesearch, except for
            disappearance of all allow rules from system_app_current
            attribute (as expected).
      Bug: 31364497
      
      Change-Id: Ifc7d350ed9749a32b0c38a78ac5f41c819dbdb96
      b5853c3b
  26. Dec 08, 2016
    • dcashman's avatar
      Restore app_domain macro and move to private use. · 3e8dbf01
      dcashman authored
      app_domain was split up in commit: 2e00e637 to
      enable compilation by hiding type_transition rules from public policy.  These
      rules need to be hidden from public policy because they describe how objects are
      labeled, of which non-platform should be unaware.  Instead of cutting apart the
      app_domain macro, which non-platform policy may rely on for implementing new app
      types, move all app_domain calls to private policy.
      
      (cherry-pick of commit: 76035ea0)
      
      Bug: 33428593
      Test: bullhead and sailfish both boot. sediff shows no policy change.
      Change-Id: I4beead8ccc9b6e13c6348da98bb575756f539665
      3e8dbf01
    • dcashman's avatar
      Restore app_domain macro and move to private use. · 76035ea0
      dcashman authored
      app_domain was split up in commit: 2e00e637 to
      enable compilation by hiding type_transition rules from public policy.  These
      rules need to be hidden from public policy because they describe how objects are
      labeled, of which non-platform should be unaware.  Instead of cutting apart the
      app_domain macro, which non-platform policy may rely on for implementing new app
      types, move all app_domain calls to private policy.
      
      Bug: 33428593
      Test: bullhead and sailfish both boot. sediff shows no policy change.
      Change-Id: I4beead8ccc9b6e13c6348da98bb575756f539665
      76035ea0
  27. 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
Loading