Skip to content
Snippets Groups Projects
  1. Jul 12, 2017
  2. Jul 10, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove cgroup access · 72b26547
      Jeff Vander Stoep authored
      Logs indicate that all processes that require read access
      have already been granted it.
      
      Bug: 28760354
      Test: build policy
      Merged-In: I5826c45f54af32e3d4296df904c8523bb5df5e62
      Change-Id: I5826c45f54af32e3d4296df904c8523bb5df5e62
      72b26547
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove cache access · 790f4c7e
      Jeff Vander Stoep authored
      Address the "granted" permissions observed in the logs including:
      
      tcontext=uncrypt
      avc: granted { search } for comm="uncrypt" name="/" dev="mmcblk0p40"
      ino=2 scontext=u:r:uncrypt:s0 tcontext=u:object_r:cache_file:s0
      tclass=dir
      
      tcontext=install_recovery
      avc: granted { search } for comm="applypatch" name="saved.file"
      scontext=u:r:install_recovery:s0 tcontext=u:object_r:cache_file:s0
      tclass=dir
      avc: granted { read } for comm="applypatch" name="saved.file"
      dev="mmcblk0p6" ino=14 scontext=u:r:install_recovery:s0
      tcontext=u:object_r:cache_file:s0 tclass=file
      avc: granted { getattr } for comm="applypatch" path="/cache/saved.file"
      dev="mmcblk0p6" ino=14 scontext=u:r:install_recovery:s0
      tcontext=u:object_r:cache_file:s0 tclass=file
      
      tcontext=update_engine
      avc: granted { search } for comm="update_engine" name="cache"
      dev="sda35" ino=1409025 scontext=u:r:update_engine:s0
      tcontext=u:object_r:cache_file:s0 tclass=dir"
      avc: granted { read } for comm="update_engine" name="update.zip"
      dev="sda35" ino=1409037 scontext=u:r:update_engine:s0
      tcontext=u:object_r:cache_file:s0:c512,c768 tclass=file
      avc: granted { read } for comm="update_engine" name="cache" dev="dm-0"
      ino=16 scontext=u:r:update_engine:s0 tcontext=u:object_r:cache_file:s0
      tclass=lnk_file
      
      Bug: 28760354
      Test: build policy.
      Merged-In: Ia13fe47268df904bd4f815c429a0acac961aed1e
      Change-Id: Ia13fe47268df904bd4f815c429a0acac961aed1e
      790f4c7e
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove access to /proc/meminfo · 3e5bb807
      Jeff Vander Stoep authored
      Logs indicate that all processes that require access already have it.
      
      Bug: 28760354
      Test: build
      Merged-In: I3dfa16bf4fba7f653c5f8525e8c565e9e24334a8
      Change-Id: I3dfa16bf4fba7f653c5f8525e8c565e9e24334a8
      3e5bb807
    • Jeff Vander Stoep's avatar
      dumpstate: remove domain_deprecated attribute · 90ae4f6b
      Jeff Vander Stoep authored
      Clean up "granted" logspam. Grant the observered audited permissions
      including:
      
      tcontext=cache_file
      avc: granted { getattr } for comm="df" path="/cache" dev="mmcblk0p9"
      ino=2 scontext=u:r:dumpstate:s0 tcontext=u:object_r:cache_file:s0
      tclass=dir
      avc: granted { search } for comm="Binder:8559_2" name="cache"
      dev="sda13" ino=1654785 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:cache_file:s0 tclass=dir
      avc: granted { read } for comm="Binder:8559_2" name="cache" dev="dm-0"
      ino=23 scontext=u:r:dumpstate:s0 tcontext=u:object_r:cache_file:s0
      tclass=lnk_file
      
      tcontext=proc
      avc: granted { getattr } for comm="Binder:14529_2"
      path="/proc/sys/fs/pipe-max-size" dev="proc" ino=247742
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc:s0
      tclass=file
      avc: granted { read } for comm="Binder:22671_2" name="cmdline"
      dev="proc" ino=4026532100 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read open } for comm="dumpstate"
      path="/proc/sys/fs/pipe-max-size" dev="proc" ino=105621
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc:s0
      tclass=file
      
      tcontext=sysfs
      avc: granted { read open } for comm="Binder:14459_2"
      path="/sys/devices/virtual/block/md0/stat" dev="sysfs" ino=51101
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { read open } for comm="Binder:21377_2"
      path="/sys/devices/soc/1da4000.ufshc/host0/target0:0:0/0:0:0:1/block/sdb/sdb1"
      dev="sysfs" ino=40888 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:sysfs:s0 tclass=dir
      avc: granted { getattr } for comm="dumpstate" dev="sysfs" ino=40456
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      
      tcontext=proc_meminfo
      avc: granted { read } for comm="top" name="meminfo" dev="proc"
      ino=4026532106 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_meminfo:s0 tclass=file
      avc: granted { read open } for comm="top" path="/proc/meminfo"
      dev="proc" ino=4026532106 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_meminfo:s0 tclass=file
      
      tcontext=rootfs
      avc: granted { getattr } for comm="df" path="/" dev="dm-0" ino=2
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:rootfs:s0 tclass=dir
      avc: granted { getattr } for comm="ip" path="/vendor" dev="rootfs"
      ino=99 scontext=u:r:dumpstate:s0 tcontext=u:object_r:rootfs:s0
      tclass=lnk_file
      
      tcontext=selinuxfs
      avc: granted { getattr } for comm="df" path="/sys/fs/selinux"
      dev="selinuxfs" ino=1 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:selinuxfs:s0 tclass=dir
      
      tcontext=system_file
      avc: granted { read open } for comm="dumpstate" path="/system/lib64/hw"
      dev="dm-0" ino=1947 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:system_file:s0 tclass=dir
      
      tcontext=system_data_file
      avc: granted { read } for comm="ip" path="/data/misc/net/rt_tables"
      dev="sda10" ino=1458261 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:system_data_file:s0 tclass=file
      avc: granted { getattr } for comm="ip" path="/data/misc/net/rt_tables"
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      
      Bug: 28760354
      Test: Build policy
      Change-Id: Iae69f710d6b6dc6158cf6bb6ff61168c8df11263
      90ae4f6b
    • Jeff Vander Stoep's avatar
      Remove dumpstate selinux spam from logs · f4ce8f6c
      Jeff Vander Stoep authored
      Addresses:
      avc: granted { read } for name="pipe-max-size" dev="proc" ino=470942 scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read open } for path="/proc/sys/fs/pipe-max-size" dev="proc" ino=470942 scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Test: build policy
      Change-Id: I7d8721c73c4f3c51b3885a97c697510e61d1221b
      (cherry picked from commit f44002b3)
      f4ce8f6c
  3. Jul 06, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove tmpfs dir access · ca5bb337
      Jeff Vander Stoep authored
      Address "granted" audit messages for dumpstate use of df.
      
      avc: granted { getattr } for comm="df" path="/mnt" dev="tmpfs"
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:tmpfs:s0
      tclass=dir
      avc: granted { search } for comm="df" name="/" dev="tmpfs"
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:tmpfs:s0
      tclass=dir
      
      Bug: 28760354
      Test: Build, check logs.
      Change-Id: I920948a5f0bce1b4bd2f15779730df8b3b1fea5a
      ca5bb337
  4. Jul 03, 2017
    • Jeff Vander Stoep's avatar
      recovery: clean up audit logspam · 9bbe420b
      Jeff Vander Stoep authored
      avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
      avc: granted { getattr } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
      
      Fixes: 62619253
      Test: policy builds, no more "granted" messages in dmesg for recovery.
      Merged-In: I3f6d8ceee80307a01a8fd40cb4f8362a9825b1a3
      Change-Id: I3f6d8ceee80307a01a8fd40cb4f8362a9825b1a3
      (cherry picked from commit ea1d6e7d)
      9bbe420b
    • Jeff Sharkey's avatar
      Allow installd to delete files via sdcardfs. · dd57e698
      Jeff Sharkey authored
      When installd clears cached files on external storage, the sdcardfs
      kernel filesystem needs to be kept in the loop to release any cached
      dentries that it's holding onto.  (Otherwise the underlying disk
      space isn't actually released.)
      
      installd can already delete the underlying files directly (via the
      media_rw_data_file rules), so this technically isn't expanding its
      capabilities.
      
      avc: granted { search } for name="/" dev="tmpfs" ino=6897 scontext=u:r:installd:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
      avc: denied { open } for path="/mnt/runtime/default/emulated/0/Android/data" dev="sdcardfs" ino=589830 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=1
      avc: denied { write } for name="com.google.android.inputmethod.japanese" dev="sdcardfs" ino=590040 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
      avc: denied { remove_name } for name="cache_r.m" dev="sdcardfs" ino=589868 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
      avc: denied { getattr } for path="/mnt/runtime/default/emulated/0/Android/data/.nomedia" dev="sdcardfs" ino=589831 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
      
      Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
      Bug: 37486230
      Change-Id: Icfd00a9ba379b1f50c48fe85849304cf9859bcb2
      (cherry picked from commit 72f4c619)
      dd57e698
    • Jeff Vander Stoep's avatar
      domain_deprecated: remove ion access · 88e4be54
      Jeff Vander Stoep authored
      Logs show that only dumpstate requires access.
      
      avc: granted { read open } for comm="screencap" path="/dev/ion"
      dev="tmpfs" ino=14324 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:ion_device:s0 tclass=chr_file
      avc: granted { ioctl } for comm="screencap" path="/dev/ion" dev="tmpfs"
      ino=14324 ioctlcmd=4906 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:ion_device:s0 tclass=chr_file
      
      Grant ion permission to dumpstate which uses it for screencap
      feature.
      
      Bug: 28760354
      Test: build. Check logs.
      Change-Id: I6435b7dbf7656669dac5dcfb205cf0aeda93991b
      88e4be54
  5. Jul 01, 2017
  6. Jun 19, 2017
    • Yabin Cui's avatar
      Avoid audit when running `adb shell -t run-as xxx`. · 3b7d9e49
      Yabin Cui authored
      run-as uses file descriptor created by adbd when running
      `adb shell -t run-as xxx`. It produces audit warnings like below:
      
      [ 2036.555371] c1    509 type=1400 audit(1497910817.864:238): avc: granted { use } for pid=4945 comm="run-as" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:runas:s0 tcontext=u:r:adbd:s0 tclass=fd
      
      Bug: http://b/62358246
      Test: test manually that the warning disappears.
      Change-Id: I19023ac876e03ce2afe18982fe753b07e4c876bb
      3b7d9e49
  7. May 08, 2017
    • Nick Kralevich's avatar
      Further restrict SELinux API access · 14e2e926
      Nick Kralevich authored
      Remove SELinux access from domain_deprecated. Access to SELinux APIs can
      be granted on a per-domain basis.
      
      Remove appdomain access to SELinux APIs. SELinux APIs are not public and
      are not intended for application use. In particular, some exploits poll
      on /sys/fs/selinux/enforce to determine if the attack was successful,
      and we want to ensure that the behavior isn't allowed. This access was
      only granted in the past for CTS purposes, but all the relevant CTS
      tests have been moved to the shell domain.
      
      Bug: 27756382
      Bug: 28760354
      Test: Device boots and no obvious problems. No collected denials.
      Change-Id: Ide68311bd0542671c8ebf9df0326e512a1cf325b
      14e2e926
  8. Apr 13, 2017
    • Jeff Vander Stoep's avatar
      bluetooth: Remove domain_deprecated · ff1e0184
      Jeff Vander Stoep authored
      Remove domain_deprecated from bluetooth. This removes some unnecessarily
      permissive rules.
      
      Bug: 25433265
      Test: All of the permissions being removed were being audited. Verify
            that no audited (granted) avc messages for bluetooth exist in
            in the logs.
      
      Change-Id: Ifa12a0f1533edcb623bbb9631f88f1ff1d6d7085
      ff1e0184
  9. Mar 07, 2017
    • Roshan Pius's avatar
      sepolicy: Make wpa_supplicant a HIDL service · a976e64d
      Roshan Pius authored
      Note: The existing rules allowing socket communication will be removed
      once we  migrate over to HIDL completely.
      
      (cherry-pick of 2a9595ed) 
      Bug: 34603782
      Test: Able to connect to wifi networks.
      Test: Will be sending for full wifi integration tests
      (go/wifi-test-request)
      Change-Id: I9ee238fd0017ec330f6eb67ef9049211f7bd4615
      a976e64d
  10. Feb 10, 2017
    • Nick Kralevich's avatar
      domain_deprecated.te: remove auditallow statements on user builds · 596dd09f
      Nick Kralevich authored
      Make the policy smaller and less noisy on user builds by suppressing
      auditallow rules.
      
      Bug: 28760354
      Test: policy compiles and device boots. No obvious problems.
      Change-Id: Iddf6f12f8ce8838e84b09b2f9f3f0c8b700543f5
      596dd09f
    • Nick Kralevich's avatar
      init.te: remove domain_deprecated · b59c2016
      Nick Kralevich authored
      auditallows have been in place for a while, and no obvious denials.
      Remove domain_deprecated from init.te
      
      While I'm here, clean up the formatting of the lines in
      domain_deprecated.te.
      
      Bug: 28760354
      Test: policy compiles and device boots. No obvious problems.
      Change-Id: Ia12e77c3e25990957abf15744e083eed9ffbb056
      b59c2016
    • 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
    • Nick Kralevich's avatar
      exclude init from apk_data_file getattr · 5ee3151a
      Nick Kralevich authored
      Addresses the following auditallow spam:
      
      avc: granted { getattr } for comm="init"
      path="/data/app/com.sling-1/lib/x86/libavcodec-56.so" dev="mmcblk0p11"
      ino=32607 scontext=u:r:init:s0 tcontext=u:object_r:apk_data_file:s0
      tclass=file
      
      Test: policy compiles.
      Change-Id: I81775f8de93f0b4334279e9f5e19d27e6171616f
      5ee3151a
  11. Jan 18, 2017
    • Josh Gao's avatar
      Introduce crash_dump debugging helper. · cb3eb4ee
      Josh Gao authored
      Replace the global debuggerd with a per-process debugging helper that
      gets exec'ed by the process that crashed.
      
      Bug: http://b/30705528
      Test: crasher/crasher64, `debuggerd <pid>`, `kill -ABRT <pid>`
      Change-Id: Iad1b7478f7a4e2690720db4b066417d8b66834ed
      cb3eb4ee
  12. Jan 07, 2017
  13. Nov 30, 2016
    • Nick Kralevich's avatar
      domain_deprecated.te: remove /proc/net access · dd649da8
      Nick Kralevich authored
      Remove /proc/net access to domain_deprecated. Add it to domains where it
      was missing before.
      
      Other than these domains, SELinux denial monitoring hasn't picked up any
      denials related to /proc/net
      
      Bug: 28760354
      Test: Device boots
      Test: No unexpected denials in denial collection logs.
      Change-Id: Ie5bfa4bc0070793c1e8bf3b00676fd31c08d426a
      dd649da8
  14. Nov 28, 2016
    • Nick Kralevich's avatar
      Add directory read permissions to certain domains. · 49e35884
      Nick Kralevich authored
      Addresses the following denials and auditallows:
      
      avc: denied { read } for pid=561 comm="hwservicemanage" name="hw"
      dev="dm-0" ino=1883 scontext=u:r:hwservicemanager:s0
      tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      avc: denied { read } for pid=748 comm="gatekeeperd" name="hw" dev="dm-0"
      ino=1883 scontext=u:r:gatekeeperd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir permissive=0
      
      avc: granted { read open } for pid=735 comm="fingerprintd"
      path="/system/lib64/hw" dev="dm-0" ino=1883 scontext=u:r:fingerprintd:s0
      tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: no denials on boot
      Change-Id: Ic363497e3ae5078e564d7195f3739a654860a32f
      49e35884
  15. Nov 26, 2016
  16. Nov 20, 2016
    • Nick Kralevich's avatar
      domain_deprecated.te: delete stale permissions · f2de0752
      Nick Kralevich authored
      auditallows have been in place for quite a while now, and nothing has
      triggered. Let's do some cleanup!
      
      Bug: 28760354
      Test: device boots and no new denials
      Test: SELinux denials collection has seen no instances of these
            permissions
      Change-Id: I9293f8d8756c9db6307e344c32cd11b9e0183e7f
      f2de0752
  17. Nov 08, 2016
    • Nick Kralevich's avatar
      installd: r_dir_file(installd, system_file) · 68f23364
      Nick Kralevich authored
      Allow installd to read through files, directories, and symlinks
      on /system. This is needed to support installd using files in
      /system/app and /system/priv-app
      
      Addresses the following auditallow spam:
      
      avc: granted { getattr } for comm="installd"
      path="/system/app/Bluetooth/lib/arm/libbluetooth_jni.so"
      dev="mmcblk0p41" ino=19 scontext=u:r:installd:s0
      tcontext=u:object_r:system_file:s0 tclass=lnk_file
      
      avc: granted { getattr } for comm="installd"
      path="/system/priv-app/MtpDocumentsProvider/lib/arm64/libappfuse_jni.so"
      dev="dm-0" ino=2305 scontext=u:r:installd:s0
      tcontext=u:object_r:system_file:s0 tclass=lnk_file
      
      avc: granted { read open } for comm="installd"
      path="/system/priv-app/TelephonyProvider" dev="mmcblk0p43" ino=1839
      scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      avc: granted { read } for comm="installd" name="Velvet" dev="mmcblk0p43"
      ino=1841 scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir
      
      avc: granted { read open } for comm="installd"
      path="/system/priv-app/GoogleOneTimeInitializer" dev="mmcblk0p43"
      ino=1778 scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir
      
      avc: granted { read open } for comm="installd"
      path="/system/app/PlayAutoInstallConfig" dev="mmcblk0p43" ino=112
      scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: policy compiles
      Change-Id: I5d14ea2cd7d281f949d0651b9723d5b7fae2e1f2
      68f23364
  18. Oct 29, 2016
    • Nick Kralevich's avatar
      Get rid of more auditallow spam · 2c8ea36a
      Nick Kralevich authored
      Addresses the following audit messages:
      
      [    7.984957] type=1400 audit(33873666.610:40): avc: granted { getattr
      } for pid=1 comm="init" name="system@framework@boot-ext.art" dev="dm-2"
      ino=106324 scontext=u:r:init:s0
      tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
      
      [   65.528068] type=1400 audit(1477751916.508:96): avc: granted { search
      } for pid=6330 comm="main" name="/" dev="cgroup" ino=12428
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      [   65.530425] type=1400 audit(1477751916.508:97): avc: granted { search
      } for pid=6330 comm="main" name="/" dev="cgroup" ino=12428
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      [   65.530487] type=1400 audit(1477751916.508:98): avc: granted { open }
      for pid=6330 comm="main" path="/dev/cpuctl/tasks" dev="cgroup" ino=12429
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=file
      
      [   65.530800] type=1400 audit(1477751916.508:98): avc: granted { open }
      for pid=6330 comm="main" path="/dev/cpuctl/tasks" dev="cgroup" ino=12429
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=file
      
      [   65.530842] type=1400 audit(1477751916.508:99): avc: granted { search
      } for pid=6330 comm="main" name="/" dev="cgroup" ino=12428
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      [   65.531138] type=1400 audit(1477751916.508:99): avc: granted { search
      } for pid=6330 comm="main" name="/" dev="cgroup" ino=12428
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      [   65.531176] type=1400 audit(1477751916.508:100): avc: granted {
      search } for pid=6330 comm="main" name="bg_non_interactive" dev="cgroup"
      ino=12444 scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0
      tclass=dir
      
      [   65.531465] type=1400 audit(1477751916.508:100): avc: granted {
      search } for pid=6330 comm="main" name="bg_non_interactive" dev="cgroup"
      ino=12444 scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0
      tclass=dir
      
      [   65.531502] type=1400 audit(1477751916.508:101): avc: granted { open
      } for pid=6330 comm="main" path="/dev/cpuctl/bg_non_interactive/tasks"
      dev="cgroup" ino=12445 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:cgroup:s0 tclass=file
      
      [   65.531789] type=1400 audit(1477751916.508:101): avc: granted { open
      } for pid=6330 comm="main" path="/dev/cpuctl/bg_non_interactive/tasks"
      dev="cgroup" ino=12445 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:cgroup:s0 tclass=file
      
      [   65.531827] type=1400 audit(1477751916.508:102): avc: granted {
      search } for pid=6330 comm="main" name="/" dev="cgroup" ino=12459
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      [   65.713056] type=1400 audit(1477751916.508:102): avc: granted {
      search } for pid=6330 comm="main" name="/" dev="cgroup" ino=12459
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:cgroup:s0 tclass=dir
      
      Bug: 32246161
      Test: policy compiles
      Test: dumpstate no longer generates the audit messages above.
      Change-Id: Id5afe2ebeb24f8a7407aac1a0a09806b1521b0e4
      2c8ea36a
  19. Oct 28, 2016
    • Nick Kralevich's avatar
      Get rid of auditallow spam. · 79a08e13
      Nick Kralevich authored
      Fixes the following SELinux messages when running adb bugreport:
      
      avc: granted { read } for name="libart.so" dev="dm-0" ino=1886
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0 tclass=file
      
      avc: granted { read open } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { getattr } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read execute } for path="/system/lib64/libart.so"
      dev="dm-0" ino=1886 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:libart_file:s0 tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { read } for path="/system/lib64/libart.so" dev="dm-0"
      ino=1886 scontext=u:r:dumpstate:s0 tcontext=u:object_r:libart_file:s0
      tclass=file
      
      avc: granted { search } for name="dalvik-cache" dev="dm-2" ino=106289
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      avc: granted { getattr } for path="/data/dalvik-cache/arm64" dev="dm-2"
      ino=106290 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:dalvikcache_data_file:s0 tclass=dir
      
      avc: granted { search } for name="dalvik-cache" dev="dm-2" ino=106289
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      avc: granted { search } for name="arm64" dev="dm-2" ino=106290
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      avc: granted { getattr } for
      path="/data/dalvik-cache/arm64/system@framework@boot.art" dev="dm-2"
      ino=106318 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
      
      avc: granted { search } for name="dalvik-cache" dev="dm-2" ino=106289
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      avc: granted { search } for name="arm64" dev="dm-2" ino=106290
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      avc: granted { read } for name="system@framework@boot.art" dev="dm-2"
      ino=106318 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
      
      avc: granted { read open } for
      path="/data/dalvik-cache/arm64/system@framework@boot.art" dev="dm-2"
      ino=106318 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
      
      avc: granted { search } for name="dalvik-cache" dev="dm-2" ino=106289
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:dalvikcache_data_file:s0
      tclass=dir
      
      [  169.349480] type=1400 audit(1477679159.734:129): avc: granted { read
      } for pid=6413 comm="main" name="ipv6_route" dev="proc" ino=4026535947
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.350030] type=1400 audit(1477679159.734:130): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/ipv6_route"
      dev="proc" ino=4026535947 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.350361] type=1400 audit(1477679159.734:130): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/ipv6_route"
      dev="proc" ino=4026535947 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.350399] type=1400 audit(1477679159.734:131): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/ipv6_route"
      dev="proc" ino=4026535947 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.350963] type=1400 audit(1477679159.734:131): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/ipv6_route"
      dev="proc" ino=4026535947 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.351002] type=1400 audit(1477679159.734:132): avc: granted { read
      } for pid=6413 comm="main" name="if_inet6" dev="proc" ino=4026535946
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.351330] type=1400 audit(1477679159.734:132): avc: granted { read
      } for pid=6413 comm="main" name="if_inet6" dev="proc" ino=4026535946
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.351366] type=1400 audit(1477679159.734:133): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.351861] type=1400 audit(1477679159.734:133): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.351910] type=1400 audit(1477679159.734:134): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.353105] type=1400 audit(1477679159.734:134): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.353186] type=1400 audit(1477679159.734:135): avc: granted { read
      } for pid=6413 comm="main" name="if_inet6" dev="proc" ino=4026535946
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.353594] type=1400 audit(1477679159.734:135): avc: granted { read
      } for pid=6413 comm="main" name="if_inet6" dev="proc" ino=4026535946
      scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.353636] type=1400 audit(1477679159.734:136): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.354230] type=1400 audit(1477679159.734:136): avc: granted { read
      open } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.354437] type=1400 audit(1477679159.734:137): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      [  169.395359] type=1400 audit(1477679159.734:137): avc: granted {
      getattr } for pid=6413 comm="main" path="/proc/6413/net/if_inet6"
      dev="proc" ino=4026535946 scontext=u:r:dumpstate:s0
      tcontext=u:object_r:proc_net:s0 tclass=file
      
      Test: policy compiles
      Test: adb bugreport runs without auditallow messages above.
      Bug: 32246161
      Change-Id: Ie0ab2ed3c6babc1f93d3b8ae47c92dd905ebc93a
      79a08e13
  20. 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
  21. Oct 02, 2016
  22. Oct 01, 2016
    • Jeff Vander Stoep's avatar
      mediaserver drmserver: remove domain_deprecated attribute · 3a0721a3
      Jeff Vander Stoep authored
      avc: granted { use } for pid=3067 comm="SoundPoolThread"
      scontext=u:r:drmserver:s0 tcontext=u:r:system_server:s0 tclass=fd
      
      Test: builds/boots on Angler. Adds permissions for all "granted" avc
      messages observed in three months of log auditing.
      
      Bug: 28760354
      Change-Id: I51f13d7c7d40f479b1241dfcd5d925d28f74926b
      3a0721a3
  23. Sep 24, 2016
  24. Sep 13, 2016
  25. Sep 12, 2016
  26. Sep 10, 2016
  27. 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: domain_deprecate: remove observed audit messages · 3dfef1fd
      Jeff Vander Stoep authored
      (cherry picked from commit 8486f4e6)
      
      Grant observed permissions
      
      Addresses:
      init
      avc:  granted  { use } for  pid=1 comm="init" path="/sys/fs/selinux/null" dev="selinuxfs" ino=22 scontext=u:r:init:s0 tcontext=u:r:kernel:s0 tclass=fd
      
      mediaextractor
      avc: granted { getattr } for pid=582 comm="mediaextractor" path="/proc/meminfo" dev="proc" ino=4026535447 scontext=u:r:mediaextractor:s0 tcontext=u:object_r:proc_meminfo:s0 tclass=file
      avc: granted { read } for pid=582 comm="mediaextractor" name="meminfo" dev="proc" ino=4026535447 scontext=u:r:mediaextractor:s0 tcontext=u:object_r:proc_meminfo:s0 tclass=file
      avc: granted { read open } for pid=582 comm="mediaextractor" path="/proc/meminfo" dev="proc" ino=4026535447 scontext=u:r:mediaextractor:s0 tcontext=u:object_r:proc_meminfo:s0 tclass=file
      
      uncrypt
      avc: granted { getattr } for pid=6750 comm="uncrypt" path="/fstab.angler" dev="rootfs" ino=9809 scontext=u:r:uncrypt:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read } for pid=6750 comm="uncrypt" name="fstab.angler" dev="rootfs" ino=9809 scontext=u:r:uncrypt:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read open } for pid=6750 comm="uncrypt" path="/fstab.angler" dev="rootfs" ino=9809 scontext=u:r:uncrypt:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      
      Bug: 28760354
      Change-Id: Ibd51473c55d957aa7375de60da67cdc6504802f9
      3dfef1fd
    • 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
Loading