- Jul 16, 2017
-
-
Tianjie Xu authored
The denial message: update_engine: type=1400 audit(0.0:15213): avc: denied { getattr } for path="/postinstall" dev="dm-0" ino=38 scontext=u:r:update_engine:s0 tcontext=u:object_r:postinstall_mnt_dir:s0 tclass=dir permissive=0 update_engine: type=1400 audit(0.0:15214): avc: denied { sys_rawio } for capability=17 scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0 tclass=capability permissive=0 auditd : type=1400 audit(0.0:15213): avc: denied { getattr } for comm="update_engine" path="/postinstall" dev="dm-0" ino=38 scontext=u:r:update_engine:s0 tcontext=u:object_r:postinstall_mnt_dir:s0 tclass=dir permissive=0 update_engine: [0428/070905:ERROR:utils.cc(716)] Error stat'ing /postinstall: Permission denied Bug: 37760573 Test: apply an update and UE reads postinstall_mnt_dir without denial. Change-Id: I55506f5e8544233f60ccf7c1df846c9c93946a25
-
Lorenzo Colitti authored
This was previously relying on domain_deprecated rules deleted in change I588a1e7ea7ef984907b79a5a391efb2dcd6e6431. Bug: 28760354 Test: unbreaks networking on AOSP bullhead Change-Id: I873e1f08f72104dee7509e45b1db0b284ca56085
-
- Jul 13, 2017
-
-
Stephen Smalley authored
Kernel commit f9df6458218f4fe ("selinux: export validatetrans decisions") introduced a /sys/fs/selinux/validatetrans pseudo file for use by userspace file system servers and defined a new validatetrans permission to control its use. Define the new permission in the Android SELinux policy. This change only defines the new permission; it does not allow it to any domains by default. This avoids a kernel message warning about the undefined permission on the policy load, ala: SELinux: Permission validate_trans in class security not defined in policy. Test: Policy builds Change-Id: Ib922a83b7d8f94905207663a72f7a1bc3db8d2c2 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Treehugger Robot authored
-
Lorenzo Colitti authored
-
Lorenzo Colitti authored
This change must only be submitted when device-specific policies have been reverted. This reverts commit 07e631d2. Bug: 17613910 Test: builds Change-Id: Ie33e293107bf1eba2498f2422d941544c76b8cad Merged-In: I356c39a5dc955b3d7c28d8c7baf2887a17beb272
-
Andreas Gampe authored
Allow wrapped app to send pid back to zygote. Bug: 63566721 Bug: 63635227 Test: lunch angler-userdebug && m Test: lunch angler-user && m Test: lunch angler-user && m && fastboot flashall && m cts && cts-tradefed run commandAndExit cts-dev -m CtsWrapWrapDebugTestCases Change-Id: Ie1b41c3eb124aa5ee321c124d0121a0e965f0f0e
-
- Jul 12, 2017
-
-
Jeff Vander Stoep authored
Logs indicate that these rules have already been moved to the domains that need them. Bug: 28760354 Test: build Merged-In: I588a1e7ea7ef984907b79a5a391efb2dcd6e6431 Change-Id: I588a1e7ea7ef984907b79a5a391efb2dcd6e6431
-
Jeff Vander Stoep authored
Observed audited access to rootfs moved to individual domains in commit a12aad45 Bug: 28760354 Test: build Change-Id: Ie5e991d66668e70df69f21334032be6d574bf5c8
-
Lorenzo Colitti authored
-
- Jul 11, 2017
-
-
Robert Benea authored
-
Jeff Vander Stoep authored
Grant audited permissions collected in logs. tcontext=platform_app avc: granted { getattr } for comm=496E666C6174657254687265616420 path="/" dev="dm-0" ino=2 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir tcontext=system_app avc: granted { getattr } for comm="android:ui" path="/" dev="dm-0" scontext=u:r:system_app:s0 tcontext=u:object_r:rootfs:s0 tclass=dir avc: granted { getattr } for comm="android:ui" path="/" dev="dm-0" scontext=u:r:system_app:s0 tcontext=u:object_r:rootfs:s0 tclass=dir tcontext=update_engine avc: granted { getattr } for comm="update_engine" path="/" dev="dm-0" ino=2 scontext=u:r:update_engine:s0 tcontext=u:object_r:rootfs:s0 tclass=dir avc: granted { getattr } for comm="update_engine" path="/fstab.foo" dev="dm-0" ino=25 scontext=u:r:update_engine:s0 tcontext=u:object_r:rootfs:s0 tclass=file avc: granted { read open } for comm="update_engine" path="/fstab.foo" dev="dm-0" ino=25 scontext=u:r:update_engine:s0 tcontext=u:object_r:rootfs:s0 tclass=file Bug: 28760354 Test: build Change-Id: I6135eea1d10b903a4a7e69da468097f495484665
-
Robert Benea authored
Allow lmkd to access /dev/memcg once again. Test: lmkd can access memcg bug: 36588803 Change-Id: I1f46b438050d95cebd2fcc495938192305fc9fc9
-
- Jul 10, 2017
-
-
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
-
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
-
Stephen Smalley authored
Kernel commit 3ba4bf5f1e2c ("selinux: add a map permission check for mmap") added a map permission check on mmap so that we can distinguish memory mapped access (since it has different implications for revocation). The purpose of a separate map permission check on mmap(2) is to permit policy to prohibit memory mapping of specific files for which we need to ensure that every access is revalidated, particularly useful for scenarios where we expect the file to be relabeled at runtime in order to reflect state changes (e.g. cross-domain solution, assured pipeline without data copying). The kernel commit is anticipated to be included in Linux 4.13. This change defines map permission for the Android policy. It mirrors the definition in the kernel classmap by adding it to the common definitions for files and sockets. This will break compatibility for kernels that predate the dynamic class/perm mapping support (< 2.6.33); on such kernels, one would instead need to add map permission to the end of each file and socket access vector. This change also adds map permission to the global macro definitions for file permissions, thereby allowing it in any allow rule that uses these macros, and to specific rules allowing mapping of files from /system and executable types. This should cover most cases where it is needed, although it may still need to be added to specific allow rules when the global macros are not used. Test: Policy builds Change-Id: Iab3ccd2b6587618e68ecab58218838749fe5e7f5 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Lorenzo Colitti authored
This change did not make it into core sepolicy in time for O. The revert allows devices to define these selinux policies in vendor-specific sepolicy instead of core sepolicy. It is necessary because: 1. It is too late to change property_contexts in O. 2. Adding the netd_stable_secret prop to vendor sepolicy results in a duplicate definition error at compile time. 3. Defining a new vendor-specific context (such as net_stable_secret_vendor_prop) and applying it to persist.netd.stable_secret results in the device not booting due to attempting to apply two different contexts to the same property. Lack of the sepolicy no longer breaks wifi connectivity now that IpManager no longer considers failure to set the stable secret to be a fatal error. Once all interested devices have adopted the vendor sepolicy, this policy can safely be reinstated by reverting said vendor sepolicies in internal master. This reverts commit abb1ba65. Bug: 17613910 Test: bullhead builds, boots, connects to wifi Change-Id: Idffcf78491171c54bca9f93cb920eab9b1c47709
-
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
-
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
-
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)
-
- Jul 06, 2017
-
-
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
-
- Jul 03, 2017
-
-
Treehugger Robot authored
-
Treehugger Robot authored
-
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)
-
Jeffrey Vander Stoep authored
-
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)
-
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
-
- Jul 01, 2017
-
-
Jeff Vander Stoep authored
Logs indicate no usage of these permissions. Bug: 28760354 Test: check logs. Change-Id: I3d75aea6afd4e326f705274ab2790e5d0bbdb367
-
Treehugger Robot authored
-
Treehugger Robot authored
-
Jeff Vander Stoep authored
Logs indicate apps, system_server, and runas are the only domains that require this permission. Bug: 28760354 Test: check logs. Change-Id: I93dc53ec2d892bb91c0cd6f5d7e9cbf76b9bcd9f
-
Andres Oportus authored
Bug: 62706738 Bug: 34133340 Test: Check that uid_time_in_state can't be read from the shell without root permissions and that "dumpsys batterystats --checkin| grep ctf" shows frequency data (system_server was able to read uid_time_in_state) Change-Id: Ic6a54da4ebcc9e10b0e3af8f14a45d7408e8686e (cherry picked from commit 4dc88795)
-
Tomasz Wasilczyk authored
Bug: b/36863239 Test: manual Change-Id: I7e929926efbb1570ea9723ef3810a511c71dc11a (cherry picked from commit 38f0928f)
-
- Jun 30, 2017
-
-
Jeff Vander Stoep authored
A legitimate call to access(2) is generating a denial. Use the audit_access permission to suppress the denial on just the access() call. avc: denied { write } for name="verified_jars" scontext=u:r:dexoptanalyzer:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir Bug: 62597207 Test: build policy Test: The following cmd succeeds but no longer generates a denial adb shell cmd package compile -r bg-dexopt --secondary-dex \ com.google.android.googlequicksearchbox Change-Id: I7d03df2754c24c039bce11426bf8f317232f5e5f (cherry picked from commit 575e6270)
-
- Jun 26, 2017
-
-
Stephen Smalley authored
Linux kernel commit da69a5306ab9 ("selinux: support distinctions among all network address families") triggers a build error if a new address family is added without defining a corresponding SELinux security class. As a result, the smc_socket class was added to the kernel to resolve a build failure as part of merge commit 3051bf36c25d that introduced AF_SMC circa Linux 4.11. Define this security class and its access vector, add it to the socket_class_set macro, and exclude it from webview_zygote like other socket classes. Test: Policy builds Change-Id: Idbb8139bb09c6d1c47f1a76bd10f4ce1e9d939cb Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Treehugger Robot authored
-
- Jun 22, 2017
-
-
Treehugger Robot authored
-
Treehugger Robot authored
-
Daniel Rosenberg authored
This adds parellel rules to the ones added for media_rw_data_file to allow apps to access vfat under sdcardfs. This should be reverted if sdcardfs is modified to alter the secontext it used for access to the lower filesystem Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65 Bug: 62584229 Test: Run android.appsecurity.cts.ExternalStorageHostTest with an external card formated as vfat Signed-off-by:
Daniel Rosenberg <drosen@google.com>
-
- Jun 19, 2017
-
-
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
-