- Oct 07, 2015
-
-
Nick Kralevich authored
Simplify SELinux policy by deleting the procrank SELinux domain. procrank only exists on userdebug/eng builds, and anyone wanting to run procrank can just su to root. Bug: 18342188 Change-Id: I71adc86a137c21f170d983e320ab55be79457c16
-
David Zeuthen authored
The update_engine daemon from Brillo is expected to be used also in Android so move its selinux policy to AOSP. Put update_engine in the whitelist (currently only has the recovery there) allowing it to bypass the notallow for writing to partititions labeled as system_block_device. Also introduce the misc_block_device dev_type as update_engine in some configurations may need to read/write the misc partition. Start migrating uncrypt to use this instead of overly broad block_device:blk_file access. Bug: 23186405 Test: Manually tested with Brillo build. Change-Id: Icf8cdb4133d4bbdf14bacc6c0fa7418810ac307a
-
- Oct 06, 2015
-
-
Nick Kralevich authored
vold hasn't use the generic "block_device" label since commit 273d7ea4 (Sept 2014), and the auditallow statement in vold hasn't triggered since that time. Remove the rule which allows vold access to the generic block_device label, and remove the vold exception. Thanks to jorgelo for reminding me about this. Change-Id: Idd6cdc20f5be9a40c5c8f6d43bbf902a475ba1c9
-
- Sep 22, 2015
-
-
Jeff Vander Stoep authored
For userdebug and eng builds enforce that: - only logd and shell domains may access logd files - logd is only allowed to write to /data/misc/logd Change-Id: Ie909cf701fc57109257aa13bbf05236d1777669a
-
- Aug 25, 2015
-
-
Stephen Smalley authored
When the toolbox domain was introduced, we allowed all domains to exec it to avoid breakage. However, only domains that were previously allowed the ability to exec /system files would have been able to do this prior to the introduction of the toolbox domain. Remove the rule from domain.te and add rules to all domains that are already allowed execute_no_trans to system_file. Requires coordination with device-specific policy changes with the same Change-Id. Change-Id: Ie46209f0412f9914857dc3d7c6b0917b7031aae5 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Aug 24, 2015
-
-
Nick Kralevich authored
Revert the neverallow change portion of 356df327, in case others need to do dynamic policy updates. (cherrypicked from commit e827a8ab) Bug: 22885422 Bug: 8949824 Change-Id: If0745e7f83523377fd19082cfc6b33ef47ca0647
-
Nick Kralevich authored
Remove the ability to dynamically update SELinux policy on the device. 1) This functionality has never been used, so we have no idea if it works or not. 2) If system_server is compromised, this functionality allows a complete bypass of the SELinux policy on the device. In particular, an attacker can force a regression of the following patch * https://android-review.googlesource.com/138510 see also https://code.google.com/p/android/issues/detail?id=181826 3) Dynamic policy update can be used to bypass neverallow protections enforced in CTS, by pushing a policy to the device after certification. Such an updated policy could bring the device out of compliance or deliberately introduce security weaknesses. (cherrypicked from commit e827a8ab) Bug: 22885422 Bug: 8949824 Change-Id: I802cb61fd18a452a2bb71c02fe57cfce5b7e9dc8
-
- Aug 22, 2015
-
-
Nick Kralevich authored
Add a neverallow rule (compile time assertion) for /data/local/tmp access. /data/local/tmp is intended entirely for the shell user, and it's dangerous for other SELinux domains to access it. See, for example, this commit from 2012: https://android.googlesource.com/platform/system/core/+/f3ef1271f225d9f00bb4ebb0573eb3e03829f9a8 Change-Id: I5a7928ae2b51a574fad4e572b09e60e05b121cfe
-
- Aug 15, 2015
-
-
Nick Kralevich authored
https://android-review.googlesource.com/166419 changed the handling of non-interactive adb shells to use a socket instead of a PTY. When the stdin/stdout/stderr socket is received by /system/bin/sh, the code runs isatty() (ioctl TCGETS) to determine how to handle the file descriptor. This is denied by SELinux. Allow it for all domains. Addresses the following denial: avc: denied { ioctl } for pid=4394 comm="sh" path="socket:[87326]" dev="sockfs" ino=87326 ioctlcmd=5401 scontext=u:r:shell:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=0 TODO: When kernels are publicly available which support SELinux ioctl filtering, limit this just to ioctl 5401 (TCGETS) instead of all ioctls. Bug: 21215503 Change-Id: I5c9394f27b8f198d96df14eac4b0c46ecb9b0898
-
- Aug 14, 2015
-
-
Nick Kralevich authored
In Android 5.1, mediaserver couldn't execute any file on /system. This slightly regressed due to 8a0c25ef, which granted mediaserver access to execute /system/bin/toolbox and /system/bin/toybox Revoke that unneeded access and add a neverallow rule to prevent regressions. TODO: Remove toolbox_exec:file execute permissions from domain.te and add it back to the specific domains that need it. Change-Id: Ia7bc6028a9ffb723d4623d91cbe15c8c1bbb2eb9
-
- Aug 03, 2015
-
-
Nick Kralevich authored
Revert the neverallow change portion of 356df327, in case others need to do dynamic policy updates. Bug: 22885422 Bug: 8949824 Change-Id: If2c13d112b346db5c011a6a61bc4486b43d46d61
-
- Aug 02, 2015
-
-
Nick Kralevich authored
Remove the ability to dynamically update SELinux policy on the device. 1) This functionality has never been used, so we have no idea if it works or not. 2) If system_server is compromised, this functionality allows a complete bypass of the SELinux policy on the device. In particular, an attacker can force a regression of the following patch * https://android-review.googlesource.com/138510 see also https://code.google.com/p/android/issues/detail?id=181826 3) Dynamic policy update can be used to bypass neverallow protections enforced in CTS, by pushing a policy to the device after certification. Such an updated policy could bring the device out of compliance or deliberately introduce security weaknesses. Bug: 22885422 Bug: 8949824 Change-Id: Id98b5e09d79254816d920b92003efe8dcbe6cd2e
-
- Jul 27, 2015
-
-
Daniel Rosenberg authored
Change-Id: I08aaf89e2ef23f9528d107a1c9d66c1c9979b3ac
-
- Jul 14, 2015
-
-
Nick Kralevich authored
Init never uses / add service manager services. It doesn't make sense to allow these rules to init. Adding a rule of this type is typically caused by a process inappropriately running in init's SELinux domain, and the warning message: Warning! Service %s needs a SELinux domain defined; please fix! is ignored. In addition, add neverallow rules to domain.te which prevent nonsense SELinux service_manager rules from being added. Change-Id: Id04a50d1826fe451a9ed216aa7ab249d0393cc57
-
- Jul 13, 2015
-
-
dcashman authored
Domains have the ability to read normal tmpfs files but not symlinks. Grant this ability. In particular, allow domains to read /mnt/sdcard. Addresses the following denial: type=1400 audit(0.0:19):avc: denied { read } for comm=4173796E635461736B202333 name="sdcard" dev="tmpfs" ino=7475 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:tmpfs:s0 tclass=lnk_file permissive=0 (cherry-pick of commit: 2b0b8299) Bug: 20755029 Change-Id: Iaa5dc278b34faf33473d3e49f92d8766ae5563c0
-
dcashman authored
Domains have the ability to read normal tmpfs files but not symlinks. Grant this ability. In particular, allow domains to read /mnt/sdcard. Addresses the following denial: type=1400 audit(0.0:19):avc: denied { read } for comm=4173796E635461736B202333 name="sdcard" dev="tmpfs" ino=7475 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:tmpfs:s0 tclass=lnk_file permissive=0 Bug: 20755029 Change-Id: I0268eb00e0eb43feb2d5bca1723b87b7a44f31a9
-
- Jul 08, 2015
-
-
William Roberts authored
To help reduce code injection paths, a neverallow is placed to prevent domain, sans untrusted_app and shell, execute on data_file_type. A few data_file_type's are also exempt from this rule as they label files that should be executable. Additional constraints, on top of the above, are placed on domains system_server and zygote. They can only execute data_file_type's of type dalvikcache_data_file. Change-Id: I15dafbce80ba2c85a03c23128eae4725703d5f02 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
- Jun 23, 2015
-
-
Stephen Smalley authored
Despite removing these from AOSP policy they seem to still be present in device policies. Prohibit them via neverallow. We would also like to minimize execmem to only app domains and others using ART, but that will first require eliminating it from device-specific service domains (which may only have it due to prior incorrect handling of text relocations). Change-Id: Id1f49566779d9877835497d8ec7537abafadadc4 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Jeff Vander Stoep authored
Change-Id: I2aef01ba72cae028d5e05deddbdeff674f9a534d
-
Nick Kralevich authored
Allow vold, healthd, slideshow, and watchdogd access to /dev/kmsg. These processes log to the kernel dmesg ring buffer, so they need write access to that file. Addresses the following denials: avc: denied { write } for pid=134 comm="watchdogd" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:watchdogd:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 avc: denied { write } for pid=166 comm="healthd" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:healthd:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 avc: denied { write } for pid=180 comm="vold" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:vold:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 These denials were triggered by the change in https://android-review.googlesource.com/151209 . Prior to that change, any code which called klog_init would (unnecessarily) create the device node themselves, rather than using the already existing device node. Drop special /dev/__null__ handling from watchdogd. As of https://android-review.googlesource.com/148288 , watchdogd no longer creates it's own /dev/null device, so it's unnecessary for us to allow for it. Drop mknod from healthd, slideshow, and watchdogd. healthd and slideshow only needed mknod to create /dev/__kmsg__, which is now obsolete. watchdogd only needed mknod to create /dev/__kmsg__ and /dev/__null__, which again is now obsolete. (cherry picked from e2651972) Bug: 21242418 Change-Id: If01c8001084575e7441253f0fa8b4179ae33f534
-
- Jun 18, 2015
-
-
Nick Kralevich authored
Mako is dead. Long live mako. Bug: 21924438 Change-Id: I5413566df8f2744df7822eb1715f40958b8ad43e
-
Stephen Smalley authored
To reduce the likelihood of malicious symlink attacks, neverallow read access to shell- and app-writable symlinks. Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov> (cherry picked from commit 9d439d3d) Bug: 21924438 Change-Id: Icf1ccca71ef4395de8be8503359f76f89cc9e1a5
-
Stephen Smalley authored
To reduce the likelihood of malicious symlink attacks, neverallow read access to shell- and app-writable symlinks. Change-Id: I0dea1e6e4f0ce34531100696d230294e1b8a5500 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
William Roberts authored
Only a few daemons need transition to shell. Prevent misuse and over-privileging of shell domain. Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com> (cherry picked from commit d1fa4d3d) Bug: 21924438 Change-Id: I013143cc5ab1e95bf3f7388ce51619e0e3b18425
-
William Roberts authored
Only a few system level components should be creating and writing these files, force a type transition for shared files. Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com> (cherry picked from commit 529a8634) Change-Id: I9c4df4e332426e253dd6fcd4f8ea0348dc3a5f54 Bug: 21924438
-
- Jun 16, 2015
-
-
Stephen Smalley authored
Prohibit all but a specific set of whitelisted domains from writing to /data/dalvik-cache. This is to prevent code injection into apps, zygote, or system_server. Inspired by: https://www.nowsecure.com/blog/2015/06/16/remote-code-execution-as-system-user-on-samsung-phones/ which depended on system UID apps having write access to /data/dalvik-cache (not allowed in AOSP policy but evidently in those device policies). Prevent this from recurring. Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov> (cherry picked from commit d9bf7b3f) Change-Id: I9219ddc3af44c909af90ba694e96565f99d8190c
-
Stephen Smalley authored
Prohibit all but a specific set of whitelisted domains from writing to /data/dalvik-cache. This is to prevent code injection into apps, zygote, or system_server. Inspired by: https://www.nowsecure.com/blog/2015/06/16/remote-code-execution-as-system-user-on-samsung-phones/ which depended on system UID apps having write access to /data/dalvik-cache (not allowed in AOSP policy but evidently in those device policies). Prevent this from recurring. Change-Id: I282c7bf998421d794883e432b091ad1dcf9da67e Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Jun 08, 2015
-
-
Nick Kralevich authored
Allow vold, healthd, slideshow, and watchdogd access to /dev/kmsg. These processes log to the kernel dmesg ring buffer, so they need write access to that file. Addresses the following denials: avc: denied { write } for pid=134 comm="watchdogd" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:watchdogd:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 avc: denied { write } for pid=166 comm="healthd" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:healthd:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 avc: denied { write } for pid=180 comm="vold" name="kmsg" dev="tmpfs" ino=9248 scontext=u:r:vold:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0 These denials were triggered by the change in https://android-review.googlesource.com/151209 . Prior to that change, any code which called klog_init would (unnecessarily) create the device node themselves, rather than using the already existing device node. Drop special /dev/__null__ handling from watchdogd. As of https://android-review.googlesource.com/148288 , watchdogd no longer creates it's own /dev/null device, so it's unnecessary for us to allow for it. Drop mknod from healthd, slideshow, and watchdogd. healthd and slideshow only needed mknod to create /dev/__kmsg__, which is now obsolete. watchdogd only needed mknod to create /dev/__kmsg__ and /dev/__null__, which again is now obsolete. Bug: 21242418 Change-Id: If01c8001084575e7441253f0fa8b4179ae33f534
-
- Jun 05, 2015
-
-
Narayan Kamath authored
This reverts commit e929ad8b524a7e444008b657adaafff97b5dea79. bug: 20889739 Change-Id: I6729f4e26041b481f2442a2d8c3dfb42e2d4144a
-
- Jun 04, 2015
-
-
Narayan Kamath authored
Required by the installation flow for split APKs. bug: 20889739 Change-Id: I3e14335f3bcfe76d1d24d233f53a728a6d90e8a1
-
- May 29, 2015
-
-
Paul Lawrence authored
(chery-picked from commit 13dec5fa) Move all key management into vold Reuse vold's existing key management through the crypto footer to manage the device wide keys. Use ro.crypto.type flag to determine crypto type, which prevents any issues when running in block encrypted mode, as well as speeding up boot in block or no encryption. This is one of four changes to enable this functionality: https://android-review.googlesource.com/#/c/148586/ https://android-review.googlesource.com/#/c/148604/ https://android-review.googlesource.com/#/c/148606/ https://android-review.googlesource.com/#/c/148607/ Bug: 18151196 Change-Id: I3208b76147df9da83d34cf9034675b0689b6c3a5
-
- May 15, 2015
-
-
William Roberts authored
Change-Id: I45002cfd05e4e184bfc66039b3ae9a4af057adb1 Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-
- May 14, 2015
-
-
William Roberts authored
Only a few daemons need transition to shell. Prevent misuse and over-privileging of shell domain. Change-Id: Ib1a5611e356d7a66c2e008232c565035e3fc4956 Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-
- May 13, 2015
-
-
William Roberts authored
Only a few system level components should be creating and writing these files, force a type transition for shared files. Change-Id: Ieb8aa8a36859c9873ac8063bc5999e9468ca7533 Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-
- May 06, 2015
-
-
Dehao Chen authored
Bug: 19483574 (cherry picked from commit 7d66f783) Change-Id: If617e29b6fd36c88c157941bc9e11cf41329da48
-
Dehao Chen authored
Bug: 19483574 Change-Id: I7e4c0cf748d2b216dcb3aede3803883552b58b64
-
- May 01, 2015
-
-
Stephen Smalley authored
Prevent defining any process types without the domain attribute so that all allow and neverallow rules written on domain are applied to all processes. Prevent defining any app process types without the appdomain attribute so that all allow and neverallow rules written on appdomain are applied to all app processes. Change-Id: I4cb565314fd40e1e82c4360efb671b175a1ee389 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Stephen Smalley authored
Prevent defining any process types without the domain attribute so that all allow and neverallow rules written on domain are applied to all processes. Prevent defining any app process types without the appdomain attribute so that all allow and neverallow rules written on appdomain are applied to all app processes. Change-Id: I4cb565314fd40e1e82c4360efb671b175a1ee389 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Apr 28, 2015
-
-
Paul Lawrence authored
Move all key management into vold Reuse vold's existing key management through the crypto footer to manage the device wide keys. Use ro.crypto.type flag to determine crypto type, which prevents any issues when running in block encrypted mode, as well as speeding up boot in block or no encryption. This is one of four changes to enable this functionality: https://android-review.googlesource.com/#/c/148586/ https://android-review.googlesource.com/#/c/148604/ https://android-review.googlesource.com/#/c/148606/ https://android-review.googlesource.com/#/c/148607/ Bug: 18151196 Change-Id: I3208b76147df9da83d34cf9034675b0689b6c3a5
-
Paul Lawrence authored
This reverts commit 5287d9a8. Change-Id: I9ec0db0718da7088dc2b66f5b1749b8fb069575a
-