Skip to content
Snippets Groups Projects
  1. Sep 20, 2017
    • Tri Vo's avatar
      Explicitly label filesystem files in /proc · 62f2842c
      Tri Vo authored
      proc files needed by fwk that were labeled:
      /proc/filesystems -> proc_filesystems
      /proc/mounts -> proc_mounts
      /proc/swaps -> proc_mounts
      
      Removed access to proc label from these domains:
      e2fs, fsck, fsck_untrusted, sdcardd
      
      e2fs: added access to proc_filesystems, proc_mounts, proc_swaps
      fsck: added access to proc_mounts, proc_swaps
      fsck_untrusted: added access to proc_mounts
      sdcardd: added access to proc_filesystems
      vold: added access to proc_filesystems, proc_mounts
      
      Bug: 66199084
      Test: device boots without selinux denials to new labels or proc label.
      Change-Id: If0f19e22074419dab0b3a0c6f3a300ea8cb94523
      62f2842c
  2. Sep 14, 2017
    • Jeff Sharkey's avatar
      Move vdc commands over to Binder. · 06b1fd66
      Jeff Sharkey authored
      Use nice clean AIDL instead of dirty sockets.
      
      avc: denied { call } for pid=603 comm="vdc" scontext=u:r:vdc:s0 tcontext=u:r:servicemanager:s0 tclass=binder permissive=0
      
      Test: vdc cryptfs init_user0
      Bug: 13758960
      Change-Id: I8b0e63adad8c4c7e2b5e6aca48386d1b371ea6a5
      06b1fd66
  3. 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
  4. Sep 05, 2017
    • Peter Enderborg's avatar
      Restrict functions for vold · f295758c
      Peter Enderborg authored
      Raw sockets usually imply advanced parsers that might
      have flaws. If vold need such odd thing, force it to have
      that in a other domain like filesystem checks. Debug
      features like ptrace does not belong to vold.
      
      Bug: 64791922
      Test: Manual
      Change-Id: I75c62d13f998621f80b2049bce0505442862bf0b
      f295758c
    • Peter Enderborg's avatar
      Only allow init to start vold · acb4871f
      Peter Enderborg authored
      Hardening vold. Vold has much rights to system sensitive parts and
      are started by init. Enforce this security.
      
      Bug: 64791922
      Test: Manual
      Change-Id: I077d251d1eb7b7292e1a4a785093cb7bf5524a83
      acb4871f
  5. Jul 24, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 7c34e83f
      Jeff Vander Stoep authored
      This attribute is being actively removed from policy. Since
      attributes are not being versioned, partners must not be able to
      access and use this attribute. Move it from private and verify in
      the logs that rild and tee are not using these permissions.
      
      Bug: 38316109
      Test: build and boot Marlin
      Test: Verify that rild and tee are not being granted any of these
            permissions.
      Merged-In: I31beeb5bdf3885195310b086c1af3432dc6a349b
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      (cherry picked from commit 76aab82c)
      7c34e83f
  6. Jul 23, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecate: remove system_data_file access · 2b75437d
      Jeff Vander Stoep authored
      scontext=installd
      avc: granted { getattr } for comm="Binder:1153_7" path="/data/user/0"
      dev="sda13" ino=1097730 scontext=u:r:installd:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=runas
      avc: granted { getattr } for comm="run-as" path="/data/user/0"
      dev="sda35" ino=942082 scontext=u:r:runas:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=vold
      avc: granted { getattr } for comm="vold" path="/data/data" dev="sda45"
      ino=12 scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=lnk_file
      avc: granted { read } for comm="secdiscard"
      name="3982c444973581d4.spblob" dev="sda45" ino=4620302
      scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      
      Bug: 28760354
      Test: Build
      Change-Id: Id16c43090675572af35f1ad9defd4c368abc906b
      2b75437d
  7. Jun 23, 2017
    • Jeff Sharkey's avatar
      Let vold execute mke2fs. · 5b2b0472
      Jeff Sharkey authored
      When adopting SD cards, vold partitions and formats those devices;
      this had been working fine with the older make_ext4fs utility, but
      newer devices are switching over to mke2fs, which has a different
      SELinux label.
      
      avc: denied { execute } for name="mke2fs" dev="dm-0" ino=456 scontext=u:r:vold:s0 tcontext=u:object_r:e2fs_exec:s0 tclass=file permissive=1
      avc: denied { read open } for path="/system/bin/mke2fs" dev="dm-0" ino=456 scontext=u:r:vold:s0 tcontext=u:object_r:e2fs_exec:s0 tclass=file permissive=1
      avc: denied { execute_no_trans } for path="/system/bin/mke2fs" dev="dm-0" ino=456 scontext=u:r:vold:s0 tcontext=u:object_r:e2fs_exec:s0 tclass=file permissive=1
      avc: denied { getattr } for path="/system/bin/mke2fs" dev="dm-0" ino=456 scontext=u:r:vold:s0 tcontext=u:object_r:e2fs_exec:s0 tclass=file permissive=1
      
      Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
      Bug: 36757864, 37436961
      Change-Id: Ifb96dfca076ea58650eb32f89e850f20ae2ac102
      5b2b0472
  8. May 15, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 76aab82c
      Jeff Vander Stoep authored
      This attribute is being actively removed from policy. Since
      attributes are not being versioned, partners must not be able to
      access and use this attribute. Move it from private and verify in
      the logs that rild and tee are not using these permissions.
      
      Bug: 38316109
      Test: build and boot Marlin
      Test: Verify that rild and tee are not being granted any of these
            permissions.
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      76aab82c
  9. Apr 14, 2017
    • Jeff Vander Stoep's avatar
      restore permissions to /vendor for non-treble devices · f627e558
      Jeff Vander Stoep authored
      Relabeling /vendor and /system/vendor to vendor_file removed
      previously granted permissions. Restore these for non-treble devices.
      
      Addresses:
      avc: denied { execute_no_trans } for pid=2944 comm="dumpstate"
      path="/system/vendor/bin/wpa_cli" dev="mmcblk0p10" ino=1929
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:vendor_file:s0
      tclass=file
      
      And potentially some other bugs that have yet to surface.
      
      Bug: 37105075
      Test: build Fugu
      Change-Id: I8e7bd9c33819bf8206f7c110cbce72366afbcef8
      f627e558
  10. Mar 29, 2017
    • Sandeep Patil's avatar
      file_context: explicitly label all file context files · c9cf7361
      Sandeep Patil authored
      
      file_context files need to be explicitly labeled as they are now split
      across system and vendor and won't have the generic world readable
      'system_file' label.
      
      Bug: 36002414
      Test: no new 'file_context' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
      OTA update.
      Test: ./cts-tradefed run singleCommand cts --skip-device-info \
             --skip-preconditions --skip-connectivity-check --abi \
             arm64-v8a --module CtsSecurityHostTestCases -t \
             android.security.cts.SELinuxHostTest#testAospFileContexts
      
      Change-Id: I603157e9fa7d1de3679d41e343de397631666273
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      c9cf7361
  11. Mar 26, 2017
    • Jeff Sharkey's avatar
      Grant kernel access to new "virtual_disk" file. · 3f724c95
      Jeff Sharkey authored
      This is a special file that can be mounted as a loopback device to
      exercise adoptable storage code on devices that don't have valid
      physical media.  For example, they may only support storage media
      through a USB OTG port that is being used for an adb connection.
      
      avc: denied { read } for path="/data/misc/vold/virtual_disk" dev="sda35" ino=508695 scontext=u:r:kernel:s0 tcontext=u:object_r:vold_data_file:s0 tclass=file permissive=0
      
      Bug: 34903607
      Change-Id: I84721ec0e9495189a7d850461875df1839826212
      3f724c95
    • Jeff Sharkey's avatar
      Define policy for "loop-control" device. · a8e0f76c
      Jeff Sharkey authored
      Per loop(4), this device is the preferred way of allocating new
      loop devices since Linux 3.1.
      
      avc: denied { read write } for name="loop-control" dev="tmpfs" ino=15221 scontext=u:r:vold:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=0
      
      Bug: 34903607
      Change-Id: I1f5f62cf0a1c24c6f6453100004812af4b8e1503
      a8e0f76c
  12. Mar 07, 2017
    • Calin Juravle's avatar
      SElinux: Clean up code related to foreign dex use · 2b291121
      Calin Juravle authored
      We simplified the way we track whether or not a dex file is used by
      other apps. DexManager in the framework keeps track of the data and we
      no longer need file markers on disk.
      
      Test: device boots, foreign dex markers are not created anymore
      
      Bug: 32871170
      Change-Id: I464ed6b09439cf0342020ee07596f9aa8ae53b62
      2b291121
  13. Feb 23, 2017
    • Alex Klyubin's avatar
      Switch Keymaster HAL policy to _client/_server · f7543d27
      Alex Klyubin authored
      This switches Keymaster HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Keymaster HAL.
      
      Domains which are clients of Keymaster HAL, such as keystore and vold
      domains, are granted rules targeting hal_keymaster only when the
      Keymaster HAL runs in passthrough mode (i.e., inside the client's
      process). When the HAL runs in binderized mode (i.e., in another
      process/domain, with clients talking to the HAL over HwBinder IPC),
      rules targeting hal_keymaster are not granted to client domains.
      
      Domains which offer a binderized implementation of Keymaster HAL, such
      as hal_keymaster_default domain, are always granted rules targeting
      hal_keymaster.
      
      Test: Password-protected sailfish boots up and lock screen unlocks --
            this exercises vold -> Keymaster HAL interaction
      Test: All Android Keystore CTS tests pass -- this exercises keystore ->
            Keymaster HAL interaction:
            make cts cts-tradefed
            cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi arm64-v8a \
            --module CtsKeystoreTestCases
      Bug: 34170079
      
      Change-Id: I2254d0fdee72145721654d6c9e6e8d3331920ec7
      f7543d27
  14. Feb 10, 2017
    • Jeff Vander Stoep's avatar
      Remove logspam · a1b45600
      Jeff Vander Stoep authored
      Grant observed uses of permissions being audited in domain_deprecated.
      
      fsck
      avc: granted { getattr } for path="/" dev="dm-0" ino=2 scontext=u:r:fsck:s0 tcontext=u:object_r:rootfs:s0 tclass=dir
      
      keystore
      avc: granted { read open } for path="/vendor/lib64/hw" dev="dm-1" ino=168 scontext=u:r:keystore:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      sdcardd
      avc: granted { read open } for path="/proc/filesystems" dev="proc" ino=4026532412 scontext=u:r:sdcardd:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      update_engine
      avc: granted { getattr } for path="/proc/misc" dev="proc" ino=4026532139 scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read open } for path="/proc/misc" dev="proc" ino=4026532139 scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read } for name="hw" dev="dm-1" ino=168 scontext=u:r:update_engine:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      vold
      avc: granted { read open } for path="/vendor/lib64/hw" dev="dm-1" ino=168 scontext=u:r:vold:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: Marlin builds and boots, avc granted messages no longer observed.
      Bug: 35197529
      Change-Id: Iae34ae3b9e22ba7550cf7d45dc011ab043e63424
      a1b45600
  15. Jan 27, 2017
    • Janis Danisevskis's avatar
      Preliminary policy for hal_keymaster (TREBLE) · e8acd769
      Janis Danisevskis authored
      This adds the premissions required for
      android.hardware.keymaster@2.0-service to access the keymaster TA
      as well as for keystore and vold to lookup and use
      android.hardware.keymaster@2.0-service.
      
      IT DOES NOT remove the privileges from keystore and vold to access
      the keymaster TA directly.
      
      Test: Run keystore CTS tests
      Bug: 32020919
      
      (cherry picked from commit 5090d6f3)
      
      Change-Id: Ib02682da26e2dbcabd81bc23169f9bd0e832eb19
      e8acd769
  16. Jan 23, 2017
  17. Jan 18, 2017
    • Janis Danisevskis's avatar
      Preliminary policy for hal_keymaster (TREBLE) · 5090d6f3
      Janis Danisevskis authored
      This adds the premissions required for
      android.hardware.keymaster@2.0-service to access the keymaster TA
      as well as for keystore and vold to lookup and use
      android.hardware.keymaster@2.0-service.
      
      IT DOES NOT remove the privileges from keystore and vold to access
      the keymaster TA directly.
      
      Test: Run keystore CTS tests
      Bug: 32020919
      Change-Id: I9467ee29232cc54b48a6dae8ae240656999f73bf
      5090d6f3
  18. Dec 13, 2016
    • Max's avatar
      Removing file system remount permission from vold · 16c889c5
      Max authored
      There is no reason for vold to have this permission, and a proper
      auditallow rule has been used and monitored to ensure that nothing on
      android uses this permission.
      
      Bug: 26901147
      
      Test: Phone boots
      Change-Id: Id36ed2722348f433fe3d046a3429066338230fec
      16c889c5
  19. Nov 30, 2016
    • Max's avatar
      Added an auditallow rule to track vold remounting filesystems. · 314d8c58
      Max authored
      Vold shouldn't have this selinux permission, so this will be left in for
      a few weeks to keep track of if removing it would be an issue to any
      other processes. If not, then a follow-up CL will remove both the rule
      and the auditallow
      
      Test: This CL is a test in itself, auditallow rules shouldn't change
      behavior of SELinux policy by themselves
      Bug: 26901147
      Change-Id: Ib076448863bd54278df59a3b514c9e877eb22ee5
      314d8c58
  20. Nov 17, 2016
    • Max's avatar
      Removed a duplicate rule. · ca04f9b3
      Max authored
      Test: Device boots
      Change-Id: I151c5fb6f56850eaa215e1a917ac9ad609dbdd4a
      ca04f9b3
  21. Oct 06, 2016
    • dcashman's avatar
      Split general policy into public and private components. · cc39f637
      dcashman authored
      Divide policy into public and private components.  This is the first
      step in splitting the policy creation for platform and non-platform
      policies.  The policy in the public directory will be exported for use
      in non-platform policy creation.  Backwards compatibility with it will
      be achieved by converting the exported policy into attribute-based
      policy when included as part of the non-platform policy and a mapping
      file will be maintained to be included with the platform policy that
      maps exported attributes of previous versions to the current platform
      version.
      
      Eventually we would like to create a clear interface between the
      platform and non-platform device components so that the exported policy,
      and the need for attributes is minimal.  For now, almost all types and
      avrules are left in public.
      
      Test: Tested by building policy and running on device.
      
      Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
      cc39f637
  22. Sep 11, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · bff98015
      Jeff Vander Stoep authored
      Remove the ioctl permission for most socket types. For others, such as
      tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist
      that individual domains may extend (except where neverallowed like
      untrusted_app). Enforce via a neverallowxperm rule.
      
      Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
      bff98015
  23. Sep 10, 2016
  24. Sep 09, 2016
  25. Aug 29, 2016
  26. Jun 15, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · c71c6622
      Jeff Vander Stoep authored
      Remove the ioctl permission for most socket types. For others, such as
      tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist
      that individual domains may extend (except where neverallowed like
      untrusted_app). Enforce via a neverallowxperm rule.
      
      Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
      c71c6622
  27. Jun 14, 2016
    • dcashman's avatar
      Keep pre-existing sysfs write permissions. · 17cfd3fc
      dcashman authored
      Commit: b144ebab added the sysfs_usb
      type and granted the read perms globally, but did not add write
      permissions for all domains that previously had them.  Add the ability
      to write to sysfs_usb for all domains that had the ability to write to
      those files previously (sysfs).
      
      Address denials such as:
      type=1400 audit(1904.070:4): avc:  denied  { write } for  pid=321 comm="ueventd" name="uevent" dev="sysfs" ino=1742 scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_usb:s0 tclass=file permissive=0
      
      Bug: 28417852
      Change-Id: I4562ea73f2158ebefba74b58ca572f2176d1b849
      17cfd3fc
  28. Jun 06, 2016
  29. Apr 07, 2016
  30. Mar 11, 2016
  31. Mar 07, 2016
    • Calin Juravle's avatar
      Give vold setattr/getattr permissions to foreign dex files domain. · cfb36df7
      Calin Juravle authored
      Vold needs to be able to query if the directory exists and
      eventually to fix permissions and the owner.
      
      Typical error:
      W vold    : type=1400 audit(0.0:485): avc: denied { getattr } 
      for path="/data/misc/profiles/cur/11/foreign-dex" dev="dm-2" 
      ino=343857 scontext=u:r:vold:s0
      tcontext=u:object_r:user_profile_foreign_dex_data_file:s0 tclass=dir 
      permissive=0
      
      
      Bug: 27517932
      Change-Id: Iff10c864634baa97cc814916ee7495b262e0c7eb
      cfb36df7
  32. Feb 19, 2016
  33. Feb 05, 2016
    • Daichi Hirono's avatar
      Add SELinux label for app fuse. · e178ac5a
      Daichi Hirono authored
      The labels for filesystem and files are assigned by vold with using
      context= mount option.
      
      Change-Id: I8a9d701a46a333093a27107fc3c52b17a2af1a94
      e178ac5a
  34. Jan 27, 2016
    • Jeff Vander Stoep's avatar
      vold: grant perms from domain_deprecated · 9306072c
      Jeff Vander Stoep authored
      In preparation of removing permissions from domain_deprecated.
      
      Addresses:
      avc: denied { read } for name="fstab.flounder" dev="rootfs" ino=4729 scontext=u:r:vold:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: denied { open } for path="/fstab.flounder" dev="rootfs" ino=4729 scontext=u:r:vold:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: denied { getattr } for path="/fstab.flounder" dev="rootfs" ino=4729 scontext=u:r:vold:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      
      avc: denied { read } for name="/" dev="mmcblk0p30" ino=2 scontext=u:r:vold:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
      avc: denied { open } for path="/cache" dev="mmcblk0p30" ino=2 scontext=u:r:vold:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
      avc: denied { ioctl } for path="/cache" dev="mmcblk0p30" ino=2 ioctlcmd=5879 scontext=u:r:vold:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
      
      avc: denied { read } for name="/" dev="proc" ino=1 scontext=u:r:vold:s0 tcontext=u:object_r:proc:s0 tclass=dir
      avc: denied { open } for path="/proc" dev="proc" ino=1 scontext=u:r:vold:s0 tcontext=u:object_r:proc:s0 tclass=dir
      
      avc: denied { read } for name="psched" dev="proc" ino=4026536519 scontext=u:r:vold:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      avc: denied { open } for path="/proc/157/net/psched" dev="proc" ino=4026536519 scontext=u:r:vold:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      avc: denied { getattr } for path="/proc/157/net/psched" dev="proc" ino=4026536519 scontext=u:r:vold:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      Change-Id: I8af7edc5b06675a9a2d62bf86e1c22dbb5d74370
      avc: denied { read } for name="block" dev="sysfs" ino=2582 scontext=u:r:vold:s0 tcontext=u:object_r:sysfs:s0 tclass=dir
      avc: denied { open } for path="/sys/block" dev="sysfs" ino=2582 scontext=u:r:vold:s0 tcontext=u:object_r:sysfs:s0 tclass=dir
      9306072c
  35. Jan 21, 2016
    • Jeff Vander Stoep's avatar
      vold launched e2fsck must run in fsck domain · 67d9932c
      Jeff Vander Stoep authored
      Bug: 22821100
      Change-Id: I549abfd31f7286ad50be3adeadaf559816c0ee38
      67d9932c
    • Jeff Vander Stoep's avatar
      vold: allow execute cp and rm · d1f8f731
      Jeff Vander Stoep authored
      Used in system/vold/MoveTask.cpp
      
      Addresses:
      avc: denied { execute } for name="toolbox" dev="mmcblk0p29" ino=359 scontext=u:r:vold:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      avc: denied { read open } for path="/system/bin/toolbox" dev="mmcblk0p29" ino=359 scontext=u:r:vold:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      avc: denied { execute_no_trans } for path="/system/bin/toolbox" dev="mmcblk0p29" ino=359 scontext=u:r:vold:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file permissive=1
      
      Change-Id: I2eb6288aaed510ae5be0f3605088ace6b865ef83
      d1f8f731
Loading