Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. Sep 12, 2016
  10. Sep 10, 2016
  11. Sep 09, 2016
  12. 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
  13. Jul 26, 2016
  14. 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
  15. Jun 06, 2016
  16. 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
  17. 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
  18. 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
  19. 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
  20. Jan 16, 2016
  21. 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
  22. 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
  23. 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
  24. 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
  25. Apr 24, 2015
  26. Mar 28, 2015
    • Nick Kralevich's avatar
      kernel: allow usbfs:dir search · 883fcfcf
      Nick Kralevich authored
      The deprecated/deleted usbfs kernel driver gets really unhappy when
      SELinux denies it access to directories. On flo (3.4.0 kernel), this
      comes across as an SELinux denial followed by a kernel panic.
      
      Steps to reproduce:
      
        1. plug in a USB device.
        2. notice nothing happens.
        3. unplug the USB device
        4. plug it in again, watch for restart.
      
      Expected:
        USB device works
      
      Actual:
        [329180.030242] Host mode: Set DC level as 0x68 for flo.
        [329180.030395] msm_hsusb_host msm_hsusb_host: Qualcomm On-Chip EHCI Host Controller
        [329180.030639] Unable to create devices usbfs file
        [329180.030944] type=1400 audit(1425327845.292:12): avc: denied { search } for pid=24033 comm="kworker/0:1" name="/" dev="usbfs" ino=291099 scontext=u:r:kernel:s0 tcontext=u:object_r:usbfs:s0 tclass=dir
        [329180.060394] msm_hsusb_host msm_hsusb_host: new USB bus registered, assigned bus number 1
        [329180.091583] msm_hsusb_host msm_hsusb_host: irq 132, io mem 0x12500000
        [deleted]
        [329180.120178] hub 1-0:1.0: USB hub found
        [329180.120452] hub 1-0:1.0: 1 port detected
        [329180.123199] Unable to handle kernel NULL pointer dereference at virtual address 00000070
        [329180.123443] pgd = c0004000
        [329180.123809] [00000070] *pgd=00000000
        [329180.124206] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
        [329180.124481] CPU: 0    Tainted: G        W     (3.4.0-g2e8a935 #1)
        [329180.124908] PC is at mutex_lock+0xc/0x48
        [329180.125122] LR is at fs_create_file+0x4c/0x128
        [329180.125518] pc : [<c0916708>]    lr : [<c0440ec4>]    psr: a0000013
        [deleted]
        [329180.281005] [<c0916708>] (mutex_lock+0xc/0x48) from [<c0440ec4>] (fs_create_file+0x4c/0x128)
        [329180.281280] [<c0440ec4>] (fs_create_file+0x4c/0x128) from [<c04410c8>] (usbfs_notify+0x84/0x2a8)
        [329180.281738] [<c04410c8>] (usbfs_notify+0x84/0x2a8) from [<c009c3b8>] (notifier_call_chain+0x38/0x68)
        [329180.282257] [<c009c3b8>] (notifier_call_chain+0x38/0x68) from [<c009c600>] (__blocking_notifier_call_chain+0x44/0x58)
        [329180.282745] [<c009c600>] (__blocking_notifier_call_chain+0x44/0x58) from [<c009c628>] (blocking_notifier_call_chain+0x14/0x18)
        [329180.283264] [<c009c628>] (blocking_notifier_call_chain+0x14/0x18) from [<c043ef8c>] (generic_probe+0x74/0x84)
        [329180.283752] [<c043ef8c>] (generic_probe+0x74/0x84) from [<c04387c4>] (usb_probe_device+0x58/0x68)
        [329180.284240] [<c04387c4>] (usb_probe_device+0x58/0x68) from [<c03adc78>] (driver_probe_device+0x148/0x360)
        [329180.284576] [<c03adc78>] (driver_probe_device+0x148/0x360) from [<c03ac76c>] (bus_for_each_drv+0x4c/0x84)
        [329180.285034] [<c03ac76c>] (bus_for_each_drv+0x4c/0x84) from [<c03adfc8>] (device_attach+0x74/0xa0)
        [329180.285522] [<c03adfc8>] (device_attach+0x74/0xa0) from [<c03ac94c>] (bus_probe_device+0x28/0x98)
        [329180.286041] [<c03ac94c>] (bus_probe_device+0x28/0x98) from [<c03ab014>] (device_add+0x444/0x5e4)
        [329180.286529] [<c03ab014>] (device_add+0x444/0x5e4) from [<c042f180>] (usb_new_device+0x248/0x2e4)
        [329180.286804] [<c042f180>] (usb_new_device+0x248/0x2e4) from [<c043472c>] (usb_add_hcd+0x420/0x64c)
        [329180.287292] [<c043472c>] (usb_add_hcd+0x420/0x64c) from [<c044600c>] (msm_otg_sm_work+0xe74/0x1774)
        [329180.287811] [<c044600c>] (msm_otg_sm_work+0xe74/0x1774) from [<c0091d8c>] (process_one_work+0x280/0x488)
        [329180.288299] [<c0091d8c>] (process_one_work+0x280/0x488) from [<c00921a8>] (worker_thread+0x214/0x3b4)
        [329180.288787] [<c00921a8>] (worker_thread+0x214/0x3b4) from [<c0096b14>] (kthread+0x84/0x90)
        [329180.289276] [<c0096b14>] (kthread+0x84/0x90) from [<c000f3c8>] (kernel_thread_exit+0x0/0x8)
      
      Allow the usbfs operation.
      
      Bug: 19568950
      Change-Id: Iffdc7bd93ebde8bb75c57a324b996e1775a0fd1e
      883fcfcf
  27. Mar 26, 2015
    • dcashman's avatar
      Allow kernel to read asec_image_file. · 753b95fe
      dcashman authored
      Address the following denial encountered when installing a forward-locked apk.
      
       W loop0   : type=1400 audit(0.0:36): avc: denied { read } for path="/data/app-asec/smdl1061145377.tmp.asec" dev="mmcblk0p28" ino=180226 scontext=u:r:kernel:s0 tcontext=u:object_r:asec_image_file:s0 tclass=file
      
      Bug: 19936901
      Change-Id: I829858564a8f89677b2bb4cbd4c8fe4250ae51de
      753b95fe
  28. Feb 27, 2015
    • Nick Kralevich's avatar
      kernel.te: fix MTP sync · 1025d138
      Nick Kralevich authored
      STEPS TO REPRODUCE:
        1. Connect the device to Mac.
        2. Switch to AFT.
        3. Now AFT on Mac will show the device contents.
        4. Now drag and drop the file to device and observe.
      
      EXPECTED RESULTS:
        Should able to copy.
      
      OBSERVED RESULTS:
        Showing can not copy file and on clicking ok,
        It shows device storage can not connect and close the AFT.
      
      Addresses the following denial:
      
        W kworker/u:11: type=1400 audit(0.0:729): avc: denied { use } for path="/storage/emulated/0/Download/song2.mp3" dev="fuse" ino=143 scontext=u:r:kernel:s0 tcontext=u:r:untrusted_app:s0:c512,c768 tclass=fd
        12310 12530 E MtpRequestPacket: Malformed MTP request packet
      
      ps -Z entry:
        u:r:untrusted_app:s0:c512,c768 u0_a6     12310 203   android.process.media
      
      Bug: 15835289
      Change-Id: I47b653507f8d4089b31254c19f44706077e2e96a
      1025d138
  29. Feb 25, 2015
    • Nick Kralevich's avatar
      allow kernel to use vold file descriptors · 9fe810b7
      Nick Kralevich authored
      Vold opens ASEC containsers on the sdcard, or OBB files from app's
      home directories, both of which are supplied by vold. We need to
      allow kernel threads to access those file descriptors.
      
      Addresses the following denial:
      
        loop0   : type=1400 audit(0.0:28): avc: denied { use } for path="/mnt/secure/asec/smdl1159865753.tmp.asec" dev="mmcblk1" ino=19 scontext=u:r:kernel:s0 tcontext=u:r:vold:s0 tclass=fd permissive=0
      
      Bug: 19516891
      Change-Id: I5a3607b48f5e0e504e4b3fcaec19152c3784f49d
      9fe810b7
    • Nick Kralevich's avatar
      kernel: make kernel an mlstrustedsubject · 4308ce8c
      Nick Kralevich authored
      Addresses post-review comment in
      https://android-review.googlesource.com/130620
      
      Change-Id: I427ba99d63724eb526d41da47b95cc0ae038acdd
      4308ce8c
  30. Feb 10, 2015
  31. Oct 29, 2014
    • Stephen Smalley's avatar
      Switch kernel and init to permissive_or_unconfined(). · a523aaca
      Stephen Smalley authored
      
      Switch the kernel and init domains from unconfined_domain()
      to permissive_or_unconfined() so that we can start collecting
      and addressing denials in -userdebug/-eng builds.
      
      Also begin to address denials for kernel and init seen after
      making this switch.
      
      I intentionally did not allow the following denials on hammerhead:
      avc:  denied  { create } for  pid=1 comm="init" name="memory.move_charge_at_immigrate" scontext=u:r:init:s0 tcontext=u:object_r:init_tmpfs:s0 tclass=file
      avc:  denied  { open } for  pid=1 comm="init" name="memory.move_charge_at_immigrate" dev="tmpfs" ino=6550 scontext=u:r:init:s0 tcontext=u:object_r:init_tmpfs:s0 tclass=file
      
      These occur when init.rc does:
      write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
      because the prior command to mount the cgroup failed:
      mount cgroup none /sys/fs/cgroup/memory memory
      
      I think this is because that cgroup is not enabled in the
      kernel configuration.  If the cgroup mount succeeded,
      then this would have been a write to a cgroup:file and
      would have been allowed already.
      
      Change-Id: I9d7e31bef6ea91435716aa4312c721fbeaeb69c0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a523aaca
  32. Sep 09, 2014
    • Nick Kralevich's avatar
      Allow kernel thread to read app data files · b0a99513
      Nick Kralevich authored
      When vold mounts an OBB on behalf of another application, the kernel
      spins up the "loop0" thread to perform the mount operation. Grant
      the kernel thread the ability to read app data files, so the mount
      operation can succeed.
      
      Steps to reproduce:
      
        1) Run: runtest --path cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
      
      Expected:
      
        1) All tests pass
      
      Actual:
      
        Test failure, with the following error message:
      
        loop0   : type=1400 audit(0.0:46): avc: denied { read } for path="/data/data/com.android.cts.stub/files/test1.obb" dev="mmcblk0p16" ino=115465 scontext=u:r:kernel:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=0
        Vold    : Image mount failed (I/O error)
        MountService: Couldn't mount OBB file: -1
        StorageManager: Received message.  path=/data/data/com.android.cts.stub/files/test1.obb, state=21
        TestRunner: failed: testMountAndUnmountObbNormal(android.os.storage.cts.StorageManagerTest)
        TestRunner: ----- begin exception -----
        TestRunner: junit.framework.AssertionFailedError: OBB should be mounted
        TestRunner:    at junit.framework.Assert.fail(Assert.java:50)
        TestRunner:    at junit.framework.Assert.assertTrue(Assert.java:20)
        TestRunner:    at android.os.storage.cts.StorageManagerTest.mountObb(StorageManagerTest.java:235)
      
      Bug: 17428116
      Change-Id: Id1a39a809b6c3942ff7e08884b40e3e4eec73b6a
      b0a99513
  33. Aug 27, 2014
    • Nick Kralevich's avatar
      support kernel writes to external SDcards · 28b26bcf
      Nick Kralevich authored
      The kernel, when it creates a loop block device, starts a new
      kernel thread "loop0" (drivers/block/loop.c). This kernel thread,
      which performs writes on behalf of other processes, needs read/write
      privileges to the sdcard. Allow it.
      
      Steps to reproduce:
      0) Get device with external, removable sdcard
      1) Run: "adb install -s foo.apk"
      
      Expected:
      
        APK installs successfully.
      
      Actual:
      
        APK fails to install. Error message:
      
          Vold  E  Failed to write superblock (I/O error)
          loop0  W  type=1400 audit(0.0:3123): avc: denied { read } for path="/mnt/secure/asec/smdl1645334795.tmp.asec" dev="mmcblk1p1" ino=528 scontext=u:r:kernel:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=0
          PackageHelper  E  Failed to create secure container smdl1645334795.tmp
          DefContainer  E  Failed to create container smdl1645334795.tmp
      
      Bug: 17158723
      
      (cherry picked from commit 4c6b1350)
      
      Change-Id: Iea727ac7958fc31d85a037ac79badbe9c85693bd
      28b26bcf
Loading