Skip to content
Snippets Groups Projects
  1. Feb 22, 2018
    • Sandeep Patil's avatar
      Add label for kernel test files and executables · 34e35e9e
      Sandeep Patil authored
      
      This required for kernel to do loopback mounts on filesystem
      images created by the kernel system call tests in LTP.
      
      Add a corresponding neverallow to stop all domains from accessing
      the location at /data/local/tmp/ltp.
      
      Bug: 73220071
      Test: Boot sailfish successfully
      Test: run vts-kernel -m VtsKernelLtp -t syscalls.fchown04
      
      Change-Id: I73f5f14017e22971fc246a05751ba67be4653bca
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      34e35e9e
  2. 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
  3. Oct 09, 2017
  4. Sep 28, 2017
  5. Sep 27, 2017
    • Dan Cashman's avatar
      Fix build. Split mediaprovider from priv_app. · 3e21c5f1
      Dan Cashman authored
      This CL was accidentally reverted a second time by commit:
      cb5129f9.  Submit it for the third,
      and final, time.
      
      (cherry-pick of 5637587d
      which was in AOSP and internal master but not stage-aosp-master)
      
      Bug: 62102757
      Test: Builds and boots.
      Change-Id: I0394907e808c737422e644aec452baa3e777cf6f
      3e21c5f1
  6. Sep 26, 2017
  7. Sep 21, 2017
    • Tri Vo's avatar
      Explicitly label vold dependecies in /proc · 9bf6a953
      Tri Vo authored
      1. Labeled:
      /proc/cmdline -> proc_cmdline
      
      2. Removed access to proc label from vold domain.
      
      3. Added access proc_cmdline to these domains:
      init, kernel, vold
      
      4. Also, added proc_drop_caches access to vold.
      
      Bug: 66497047
      Test: device boots without selinux denials to new labels
      Change-Id: Ic88d11b7e56b07c0e8bd874e7f72788922a218e3
      9bf6a953
  8. Jul 10, 2017
  9. Jun 08, 2017
    • Jerry Zhang's avatar
      Revert "Split mediaprovider from priv_app." · cb5129f9
      Jerry Zhang authored
      This reverts commit c147b592.
      
      The new domain changed neverallows, breaking CTS compatability.
      Revert the domain now, with the intention to re-add for the next
      release.
      
      Bug: 62102757
      Test: domain is set to priv_app
      Change-Id: I907ff7c513cd642a306e3eaed3937352ced90005
      cb5129f9
  10. Jun 07, 2017
  11. Jun 02, 2017
    • Jerry Zhang's avatar
      Revert "Split mediaprovider from priv_app." · c00c07c1
      Jerry Zhang authored
      This reverts commit c147b592.
      
      The new domain changed neverallows, breaking CTS compatability.
      Revert the domain now, with the intention to re-add for the next
      release.
      
      Bug: 62102757
      Test: domain is set to priv_app
      Change-Id: I907ff7c513cd642a306e3eaed3937352ced90005
      c00c07c1
  12. Apr 26, 2017
    • Jerry Zhang's avatar
      Add drm and kernel permissions to mediaprovider · 6f9ac6e4
      Jerry Zhang authored
      These were missing when the sepolicy was migrated.
      
      Addresses denials:
      
      E SELinux : avc:  denied  { find } for service=drm.drmManager pid=11769
      uid=10018 scontext=u:r:mediaprovider:s0:c512,c768
      tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      
      W kworker/u16:2: type=1400 audit(0.0:1667): avc: denied { use } for
      path="/storage/emulated/0/DCIM/Camera/IMG_20170425_124723.jpg"
      dev="sdcardfs" ino=1032250 scontext=u:r:kernel:s0
      tcontext=u:r:mediaprovider:s0:c512,c768 tclass=fd permissive=0
      
      Bug: 37685394
      Bug: 37686255
      Test: Sync files
      Test: Open downloaded file
      
      Change-Id: Ibb02d233720b8510c3eec0463b8909fcc5bbb73d
      6f9ac6e4
  13. Apr 17, 2017
    • Jerry Zhang's avatar
      Split mediaprovider from priv_app. · c147b592
      Jerry Zhang authored
      MediaProvider requires permissions that diverge from those
      of a typical priv_app. This create a new domain and removes
      Mtp related permissions from priv_app.
      
      Bug: 33574909
      Test: Connect with MTP, download apps and files, select ringtones
      Test: DownloadProvider instrument tests, CtsProviderTestCases
      
      Change-Id: I950dc11f21048c34af639cb3ab81873d2a6730a9
      c147b592
    • Jerry Zhang's avatar
      Split mediaprovider as a separate domain from priv_app · 9f152d98
      Jerry Zhang authored
      MediaProvider requires permissions that diverge from those
      of a typical priv_app. This create a new domain and removes
      Mtp related permissions from priv_app.
      
      Bug: 33574909
      Test: Connect with MTP, download apps and files, select ringtones
      Test: DownloadProvider instrument tests, CtsProviderTestCases
      
      Change-Id: I950dc11f21048c34af639cb3ab81873d2a6730a9
      9f152d98
  14. 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
  15. 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
  16. Feb 22, 2017
    • Jeff Vander Stoep's avatar
      kernel: neverallow dac_{override,read_search} perms · 3927086d
      Jeff Vander Stoep authored
      The kernel should never be accessing files owned by other users.
      
      Disallow this access.
      
      Test: Marlin builds. Neverallow are build time assertions,
      they do not policy on the device.
      
      Change-Id: I6ba2eb27c0e2ecf46974059588508cd3223baceb
      3927086d
  17. Oct 31, 2016
    • Nick Kralevich's avatar
      kernel.te: tighten entrypoint / execute_no_trans neverallow · 02cfce49
      Nick Kralevich authored
      The kernel domain exists solely on boot, and is used by kernel threads.
      Because of the way the system starts, there is never an entrypoint for
      that domain, not even a file on rootfs. So tighten up the neverallow
      restriction.
      
      Remove an obsolete comment. The *.rc files no longer have a setcon
      statement, and the transition from the kernel domain to init occurs
      because init re-execs itself. The statement no longer applies.
      
      Test: bullhead policy compiles.
      Change-Id: Ibe75f3d25804453507dbb05c7a07bba1d37a1c7b
      02cfce49
  18. 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
  19. Sep 12, 2016
  20. Sep 10, 2016
  21. Sep 09, 2016
  22. Aug 29, 2016
    • Jeff Vander Stoep's avatar
      DO NOT MERGE: Allow kernel to read proc · c8820d04
      Jeff Vander Stoep authored
      (cherry picked from commit 48d68a64)
      
      Remove audit messaged.
      
      Addresses:
      avc:  granted  { read } for  pid=1 comm="init" name="cmdline" dev="proc" ino=4026535448 scontext=u:r:kernel:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc:  granted  { read open } for  pid=1 comm="init" path="/proc/cmdline" dev="proc" ino=4026535448 scontext=u:r:kernel:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Bug: 28760354
      Change-Id: I48ea01b35c6d1b255995484984ec92203b6083be
      c8820d04
    • Jeff Vander Stoep's avatar
      DO NOT MERGE: audit domain_deprecated perms for removal · fe8d6739
      Jeff Vander Stoep authored
      Grant permissions observed.
      
      (cherry picked from commit 9c820a11)
      
      Merged-in: Ifdead51f873eb587556309c48fb84ff1542ae303
      Bug: 28760354
      Change-Id: Ifdead51f873eb587556309c48fb84ff1542ae303
      fe8d6739
  23. Jul 26, 2016
  24. Jun 09, 2016
    • Jeff Vander Stoep's avatar
      Allow kernel to read proc · 48d68a64
      Jeff Vander Stoep authored
      Remove audit messaged.
      
      Addresses:
      avc:  granted  { read } for  pid=1 comm="init" name="cmdline" dev="proc" ino=4026535448 scontext=u:r:kernel:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc:  granted  { read open } for  pid=1 comm="init" path="/proc/cmdline" dev="proc" ino=4026535448 scontext=u:r:kernel:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Bug: 28760354
      Change-Id: I48ea01b35c6d1b255995484984ec92203b6083be
      48d68a64
  25. Jun 06, 2016
  26. May 03, 2016
    • Sen Jiang's avatar
      Allow reading loop device in update_engine_unittests. · 2b267293
      Sen Jiang authored
      This fixes the following denies:
      type=1400 audit(0.0:4389): avc: denied { read } for path="/data/misc/update_engine/tmp/a_loop_file.W0j9ss" dev="mmcblk0p13" ino=24695 scontext=u:r:kernel:s0 tcontext=u:object_r:update_engine_data_file:s0 tclass=file permissive=0
      type=1400 audit(0.0:30): avc: denied { read } for path="/data/nativetest/update_engine_unittests/gen/disk_ext2_unittest.img" dev="mmcblk0p13" ino=71 scontext=u:r:kernel:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=file permissive=0
      
      Bug: 28319454
      Test: setenforce 1 && ./update_engine_unittests
      
      Change-Id: I8d54709d4bda06b364b5420d196d75a4ecc011d3
      2b267293
  27. Mar 31, 2016
    • Daniel Rosenberg's avatar
      Allow access to media_rw_data_file for now. · d25d57a3
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      Added for: adbd, kernel, mediaserver, and shell
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27915475
      Bug: 27937873
      
      Change-Id: I25edcfc7fb8423b3184db84040bda790a1042724
      d25d57a3
  28. Feb 05, 2016
    • Nick Kralevich's avatar
      Replace "neverallow domain" by "neverallow *" · 35a14514
      Nick Kralevich authored
      Modify many "neverallow domain" rules to be "neverallow *" rules
      instead. This will catch more SELinux policy bugs where a label
      is assigned an irrelevant rule, as well as catch situations where
      a domain attribute is not assigned to a process.
      
      Change-Id: I5b83a2504c13b384f9dff616a70ca733b648ccdf
      35a14514
  29. Jan 28, 2016
    • Jeff Vander Stoep's avatar
      kernel: grant perms from domain_deprecated · bc2b76b0
      Jeff Vander Stoep authored
      In preparation of removing permissions from domain_deprecated.
      
      Addresses:
      avc: denied { read } for name="enforce" dev="selinuxfs" ino=4 scontext=u:r:kernel:s0 tcontext=u:object_r:selinuxfs:s0 tclass=file permissive=1
      avc: denied { open } for path="/sys/fs/selinux/enforce" dev="selinuxfs" ino=4 scontext=u:r:kernel:s0 tcontext=u:object_r:selinuxfs:s0 tclass=file permissive=1
      avc: denied { read } for name="selinux_version" dev="rootfs" ino=4765 scontext=u:r:kernel:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1
      avc: denied { open } for path="/selinux_version" dev="rootfs" ino=4765 scontext=u:r:kernel:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1
      avc: denied { getattr } for path="/selinux_version" dev="rootfs" ino=4765 scontext=u:r:kernel:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1
      
      Change-Id: I62cbffe85941677283d3b7bf8fc1c437671569a3
      bc2b76b0
  30. Jan 16, 2016
  31. Nov 03, 2015
    • Jeff Vander Stoep's avatar
      Create attribute for moving perms out of domain · d22987b4
      Jeff Vander Stoep authored
      Motivation: Domain is overly permissive. Start removing permissions
      from domain and assign them to the domain_deprecated attribute.
      Domain_deprecated and domain can initially be assigned to all
      domains. The goal is to not assign domain_deprecated to new domains
      and to start removing domain_deprecated where it is not required or
      reassigning the appropriate permissions to the inheriting domain
      when necessary.
      
      Bug: 25433265
      Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
      d22987b4
  32. Oct 28, 2015
    • Jeff Vander Stoep's avatar
      audit mtp sync permission · 94ee59bc
      Jeff Vander Stoep authored
      Determine if the following rule can be removed:
      
      allow kernel untrusted_app:fd use
      
      Bug: 25331459
      Change-Id: I4ef9f376d7fc1d2bdfba69b2fb3e24d49ac136ad
      94ee59bc
  33. Oct 27, 2015
    • Jeff Vander Stoep's avatar
      Fix MTP sync · 9ba8ade5
      Jeff Vander Stoep authored
      Address the following denial:
      avc: denied { use } for path="/storage/emulated/0/305512.pdf" dev="fuse"
      ino=239 scontext=u:r:kernel:s0 tcontext=u:r:priv_app:s0:c512,c768 tclass=fd
      permissive=0
      
      Bug: 25068662
      Change-Id: Ic29d9569ff387dfd411363db751c3642572c8e85
      9ba8ade5
  34. May 06, 2015
    • Nick Kralevich's avatar
      kernel: allow rebooting, and writing to /dev/__kmsg__ · 618efe8c
      Nick Kralevich authored
      Addresses the following denials:
      
        avc:  denied  { write } for  pid=1 comm="init" path=2F6465762F5F5F6B6D73675F5F202864656C6574656429 dev="tmpfs" ino=7214 scontext=u:r:kernel:s0 tcontext=u:object_r:tmpfs:s0 tclass=chr_file permissive=0
        avc:  denied  { write } for  pid=1 comm="init" name="sysrq-trigger" dev="proc" ino=4026534153 scontext=u:r:kernel:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0
        avc:  denied  { sys_boot } for  pid=1 comm="init" capability=22  scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
      
      (cherrypicked from commit e550e79c)
      
      Change-Id: I46be370d520c4492d97c6ed7ccdc55cc20b22c49
      618efe8c
    • Nick Kralevich's avatar
      kernel: allow rebooting, and writing to /dev/__kmsg__ · e550e79c
      Nick Kralevich authored
      Addresses the following denials:
      
        avc:  denied  { write } for  pid=1 comm="init" path=2F6465762F5F5F6B6D73675F5F202864656C6574656429 dev="tmpfs" ino=7214 scontext=u:r:kernel:s0 tcontext=u:object_r:tmpfs:s0 tclass=chr_file permissive=0
        avc:  denied  { write } for  pid=1 comm="init" name="sysrq-trigger" dev="proc" ino=4026534153 scontext=u:r:kernel:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0
        avc:  denied  { sys_boot } for  pid=1 comm="init" capability=22  scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
      
      Change-Id: I46be370d520c4492d97c6ed7ccdc55cc20b22c49
      e550e79c
  35. Apr 24, 2015
Loading