- Sep 13, 2016
-
-
Andreas Gampe authored
(cherry picked from commit eb717421) The new A/B OTA artifact naming scheme includes the target slot so that the system is robust with respect to unexpected reboots. This complicates the renaming code after reboot, so it is moved from the zygote into a simple script (otapreopt_slot) that is hooked into the startup sequence in init. Give the script the subset of the rights that the zygote had so that it can move the artifacts from /data/ota into /data/dalvik-cache. Relabeling will be done in the init rc component, so relabeling rights can be completely removed. Bug: 25612095 Bug: 28069686 Change-Id: Iad56dc3d78ac759f4f2cce65633cdaf1cab7631b
-
Andreas Gampe authored
(cherry picked from commit ec4b9d67) Vendor apps are usually not preopted, so A/B dexopt should pick them up. update_engine is not mounting the vendor partition, so let otapreopt_chroot do the work. This change gives otapreopt_chroot permission to mount /vendor into the chroot environment. Bug: 25612095 Bug: 29498238 Change-Id: I5a77bdb78a8e478ce10f6c1d0f911a8d6686becb
-
- Sep 12, 2016
-
-
Alex Light authored
(cherry picked from commit d3edd6b5) Bug: 29278988 Change-Id: I199572377a6b5c33116c718a545159ddcf50df30
-
Nick Kralevich authored
Bluetooth is sometimes started from init. Addresses the following compiler error: libsepol.report_failure: neverallow on line 489 of system/sepolicy/domain.te (or line 9149 of policy.conf) violated by allow init bluetooth:process { transition }; libsepol.check_assertions: 1 neverallow failures occurred Error while expanding policy (cherry-picked from commit 7e380216) Change-Id: I2bc1e15217892e1ba2a62c9683af0f3c0aa16b86
-
Eino-Ville Talvala authored
Previously appdomains allowed to execute off of /data where whitelisted. This had the unfortunate side effect of disallowing the creation of device specific app domains with fewer permissions than untrusted_app. Instead grant all apps a neverallow exemption and blacklist specific app domains that should still abide by the restriction. This allows devices to add new app domains that need /data execute permission without conflicting with this rule. Bug: 26906711 (cherry picked from commit c5266df9) Change-Id: I4adb58e8c8b35122d6295db58cedaa355cdd3924
-
- Sep 11, 2016
-
-
Jeff Vander Stoep authored
Remove the ioctl permission for most socket types. For others, such as tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist that individual domains may extend (except where neverallowed like untrusted_app). Enforce via a neverallowxperm rule. Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
-
- Jun 28, 2016
-
-
Jeff Vander Stoep authored
Needed for jemalloc commit: 2f970c32b527660a33fa513a76d913c812dcf7c Modify pages_map() to support mapping uncommitted virtual memory. avc: denied { read } for name="overcommit_memory" dev="proc" ino=10544 scontext=u:r:wificond:s0 tcontext=u:object_r:proc:s0 tclass=file Bug: 29773242 Change-Id: I78054c1ed576a7998c4ee1d1beca2f610c589c3a
-
- Jun 10, 2016
-
-
dcashman authored
Some legitimate functionality currently requires direct sysfs access that is not otherwise possible via the android APIs. Specifically, isochronous USB transfers require this direct access, without which USB audio applications would noticibly suffer. Grant read access to the usb files under /sys/devices to prevent this regression. Bug: 28417852 Change-Id: I3424bf3498ffa0eb647a54cc962ab8c54f291728
-
- Jun 03, 2016
-
-
William Roberts authored
The commit: d41ad551 fixes a race in coldboot. However, introduced a seperate bug where existing character files were being relabeled. The fix was to have ueventd ensure their was a delta between the old and new labels and only then call lsetfilecon(). To do this we call lgetfilecon() which calls lgetxattr(), this requires getattr permissions. This patch is void of any relabelfrom/to for ueventd on chr_file as those can be added as they occur. Bug: 29106809 Change-Id: I84f60539252fc2b4a71cf01f78e3cadcfad443ef Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
- Apr 28, 2016
-
-
William Roberts authored
Enable rules to allow shell to getattr on all block files for checking modes under /dev/block. Exempt shell from any neverallows on blk_file and limit them to only getattr. bug: 28306036 Change-Id: Ic26c0f7acfb238ff78d5d3537d51c1a70c64d196 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
William Roberts authored
Enable shell to have access to /dev for running the world accessable mode test on /dev. This approach adds shell to the list of excluded domains on neverallows around chr_files, but locks down the access for shell to only getattr. It was done this lightly more complicated way to prevent loosening the allow rules so that any domain would have getattr permissions. Change-Id: Idab466fa226ddbf004fcb1bbcaf98c8326605253
-
Mihai Serban authored
There is a race in ueventd's coldboot procedure that permits creation of device block nodes before platform devices are registered. In this case the device node links used to compute the SELinux context are not known and the node is created under the generic context: u:object_r:block_device:s0. Ueventd has been patched to relabel the nodes on subsequent add events but it needs permissions to be allowed to do it. BUG=28388946 Signed-off-by:
Mihai Serban <mihai.serban@intel.com> (cherry picked from commit d41ad551) Change-Id: I26838a3a9bc19b341e7176e5dc614827232014bf
-
Nick Kralevich authored
It doesn't ever make sense to attempt to load executable code from these files. Add a neverallow rule (compile time assertion and CTS test). Bug: 27882507 (cherry picked from commit 50ba6318) Change-Id: Ifab6e46a077a87629b4d3c7ada1050f2ab6931d5
-
Nick Kralevich authored
The misc_block_device partition is intended for the exclusive use of the OTA system, and components related to the OTA system. Disallow it's use by anyone else on user builds. On userdebug/eng builds, allow any domain to use this, since this appears to be used for testing purposes. Bug: 26470876 (cherry picked from commit 2c7a5f26) Change-Id: I40c80fa62651a0135e1f07a5e07d2ef65ba04139
-
- Apr 27, 2016
-
-
Mihai Serban authored
There is a race in ueventd's coldboot procedure that permits creation of device block nodes before platform devices are registered. In this case the device node links used to compute the SELinux context are not known and the node is created under the generic context: u:object_r:block_device:s0. Ueventd has been patched to relabel the nodes on subsequent add events but it needs permissions to be allowed to do it. BUG=28388946 Change-Id: Ic836309527a2b81accc50df38bd753d54fa5e318 Signed-off-by:
Mihai Serban <mihai.serban@intel.com>
-
- Apr 23, 2016
-
-
Nick Kralevich authored
This directory is no longer used. Change-Id: Ic32a7dd160b23ef8d1d4ffe3f7b1af56c973d73c
-
- Apr 22, 2016
-
-
Andreas Gampe authored
Give mount & chroot permissions to otapreopt_chroot related to postinstall. Add postinstall_dexopt for otapreopt in the B partition. Allow the things installd can do for dexopt. Give a few more rights to dex2oat for postinstall files. Allow postinstall files to call the system server. Bug: 25612095 Change-Id: If7407473d50c9414668ff6ef869c2aadd14264e7
-
Nick Kralevich authored
It doesn't ever make sense to attempt to load executable code from these files. Add a neverallow rule (compile time assertion and CTS test). Bug: 27882507 Change-Id: Iaa83e3ac543b2221e1178c563e18298305de6da2
-
- Apr 21, 2016
-
-
Nick Kralevich authored
(cherrypicked from commit 45737b9f) There are now individual property files to control access to properties. Don't allow processes other than init to write to these property files. Change-Id: I184b9df4555ae5051f9a2ba946613c6c5d9d4403
-
- Apr 19, 2016
-
-
mukesh agrawal authored
Restrict the ability of the shell to set the log.* properties. Namely: only allow the shell to set such properities on eng and userdebug builds. The shell (and other domains) can continue to read log.* properties on all builds. While there: harmonize permissions for log.* and persist.log.tag. Doing so introduces two changes: - log.* is now writable from from |system_app|. This mirrors the behavior of persist.log.tag, which is writable to support "Developer options" -> "Logger buffer sizes" -> "Off". (Since this option is visible on user builds, the permission is enabled for all builds.) - persist.log.tag can now be set from |shell| on userdebug_or_eng(). BUG=28221972 TEST=manual (see below) Testing details - user build (log.tag) $ adb shell setprop log.tag.foo V $ adb shell getprop log.tag <blank line> $ adb bugreport | grep log.tag.foo [ 146.525836] init: avc: denied { set } for property=log.tag.foo pid=4644 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:log_prop:s0 tclass=property_service permissive=0 [ 146.525878] init: sys_prop: permission denied uid:2000 name:log.tag.foo - userdebug build (log.tag) $ adb shell getprop log.tag.foo <blank line> $ adb shell setprop log.tag.foo V $ adb shell getprop log.tag.foo V - user build (persist.log.tag) $ adb shell getprop | grep log.tag <no match> - Developer options -> Logger buffer sizes -> Off $ adb shell getprop | grep log.tag [persist.log.tag]: [Settings] [persist.log.tag.snet_event_log]: [I] Change-Id: Idf00e7a623723a7c46bf6d01e386aeca92b2ad75
-
Nick Kralevich authored
Doesn't appear to be needed anymore. Change-Id: I7a1fcf4c17fa69c313daebb87c9b0bf654169ee0
-
- Apr 18, 2016
-
-
Jeff Vander Stoep authored
Bug: 27549740 Change-Id: I3f646984fbd9cbcb58636d158a9ac0afc5a930ce
-
- Apr 15, 2016
-
-
Jeff Vander Stoep authored
(cherry picked from commit 6ba383c5) Restrict unix_dgram_socket and unix_stream_socket to a whitelist. Disallow all ioctls for netlink_selinux_socket and netlink_route_socket. Neverallow third party app use of all ioctls other than unix_dgram_socket, unix_stream_socket, netlink_selinux_socket, netlink_route_socket, tcp_socket, udp_socket and rawip_socket. Bug: 28171804 Change-Id: Icfe3486a62fc2fc2d2abd8d4030a5fbdd0ab30ab
-
Nick Kralevich authored
(cherry picked from commit 1df23cbf) This does not appear needed anymore. Bug: 27549740 Change-Id: I3128ab610c742b18008f4cfc2a7116b210f770e7
-
Nick Kralevich authored
The misc_block_device partition is intended for the exclusive use of the OTA system, and components related to the OTA system. Disallow it's use by anyone else on user builds. On userdebug/eng builds, allow any domain to use this, since this appears to be used for testing purposes. Bug: 26470876 Change-Id: I05d4ee025bb8a5e6a1a9237fefaa2b1c646e332c
-
- Apr 09, 2016
-
-
Alex Deymo authored
postinstall_file was an exec_type so it could be an entrypoint for the domain_auto_trans from update_engine domain to postinstall domain. This patch removes the exec_type from postinstall_file and exempts it from the neverallow rule to become an entrypoint. Bug: 28008031 TEST=postinstall_example still runs as the "postinstall" domain on edison-eng. (cherry picked from commit a9671c6b) Change-Id: I2e1f61ed42f8549e959edbe047c56513903e8e9c
-
- Apr 07, 2016
-
-
Nick Kralevich authored
This does not appear needed anymore. Change-Id: I3128ab610c742b18008f4cfc2a7116b210f770e7
-
Jeff Vander Stoep authored
(cherry picked from AOSP 163c8a006b87cae0217fd9dafdaec5271f1d795b) Do not allow module loading except from the system, vendor, and boot partitions. Bug: 27824855 Change-Id: Ifc012e47c5677190c7cc564f9d48af8c7d0982e1
-
Jeff Vander Stoep authored
Do not allow module loading except from the system, vendor, and boot partitions. Bug: 27824855 Change-Id: Ifc012e47c5677190c7cc564f9d48af8c7d0982e1
-
- Apr 06, 2016
-
-
Alex Deymo authored
postinstall_file was an exec_type so it could be an entrypoint for the domain_auto_trans from update_engine domain to postinstall domain. This patch removes the exec_type from postinstall_file and exempts it from the neverallow rule to become an entrypoint. Bug: 28008031 TEST=postinstall_example still runs as the "postinstall" domain on edison-eng. Change-Id: Icbf5b262c6f971ce054f1b4896c611b32a6d66b5
-
William Roberts authored
Change-Id: Idc9552d2130750d82318d57e7c55fd280d687063 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
William Roberts authored
Prevent direct opens into the system_app sandbox. Change-Id: I04c22076939a9a09a6c861ae73da839c879c4ba7 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
- Apr 05, 2016
-
-
William Roberts authored
Do not allow other domains to create or unlink files under the system app sandbox. Change-Id: I7c3037210c6849c3b0fc205fa71fa5ed4dcac1c2 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
- Apr 01, 2016
-
-
Nick Kralevich authored
(cherry pick from commit 6937aa93) Followup to 121f5bfd. Move misc_logd_file neverallow rule from domain.te to logd.te, since the goal of the neverallow rule is to protect logd / logpersist files from other processes. Switch the misc_logd_file neverallow rule from using "rw_file_perms" to "no_rw_file_perms". The latter covers more cases of file modifications. Add more neverallow rules covering misc_logd_file directories. Instead of using not_userdebug_nor_eng(), modify the rules to be consistent with other highly constrained file types such as keystore_data_file or vold_data_file. See, for example, https://android-review.googlesource.com/144768 To see the net effect of this change, you can use the following command line: sesearch --allow -t misc_logd_file -c file,dir,lnk_file \ out/target/product/bullhead/root/sepolicy Before this change: # userdebug builds allow init misc_logd_file:dir { search setattr read create getattr write relabelfrom ioctl rmdir remove_name relabelto open add_name }; allow init misc_logd_file:file { setattr read create write relabelfrom getattr relabelto unlink open }; allow init misc_logd_file:lnk_file { setattr relabelfrom create getattr relabelto unlink }; allow logd misc_logd_file:dir { search read lock getattr write ioctl remove_name open add_name }; allow logd misc_logd_file:file { rename setattr read lock create getattr write ioctl unlink open append }; allow shell misc_logd_file:dir { search read lock getattr ioctl open }; allow shell misc_logd_file:file { read lock ioctl open getattr }; # user builds allow init misc_logd_file:dir { search setattr read create getattr write relabelfrom ioctl rmdir remove_name relabelto open add_name }; allow init misc_logd_file:file relabelto; allow init misc_logd_file:lnk_file { setattr relabelfrom create getattr relabelto unlink }; After this change: # userdebug builds allow init misc_logd_file:dir { search setattr read create getattr ioctl relabelto open }; allow init misc_logd_file:file { relabelto getattr }; allow init misc_logd_file:lnk_file relabelto; allow logd misc_logd_file:dir { search read lock getattr write ioctl remove_name open add_name }; allow logd misc_logd_file:file { rename setattr read lock create getattr write ioctl unlink open append }; allow shell misc_logd_file:dir { search read lock getattr ioctl open }; allow shell misc_logd_file:file { read lock ioctl open getattr }; # user builds allow init misc_logd_file:dir { search setattr read create getattr ioctl relabelto open }; allow init misc_logd_file:file { relabelto getattr }; allow init misc_logd_file:lnk_file relabelto; Change-Id: I0b00215049ad83182f458b4b9e258289c5144479 Bug: 27965066
-
- Mar 28, 2016
-
-
Nick Kralevich authored
Followup to 121f5bfd. Move misc_logd_file neverallow rule from domain.te to logd.te, since the goal of the neverallow rule is to protect logd / logpersist files from other processes. Switch the misc_logd_file neverallow rule from using "rw_file_perms" to "no_rw_file_perms". The latter covers more cases of file modifications. Add more neverallow rules covering misc_logd_file directories. Instead of using not_userdebug_nor_eng(), modify the rules to be consistent with other highly constrained file types such as keystore_data_file or vold_data_file. See, for example, https://android-review.googlesource.com/144768 To see the net effect of this change, you can use the following command line: sesearch --allow -t misc_logd_file -c file,dir,lnk_file \ out/target/product/bullhead/root/sepolicy Before this change: # userdebug builds allow init misc_logd_file:dir { search setattr read create getattr write relabelfrom ioctl rmdir remove_name relabelto open add_name }; allow init misc_logd_file:file { setattr read create write relabelfrom getattr relabelto unlink open }; allow init misc_logd_file:lnk_file { setattr relabelfrom create getattr relabelto unlink }; allow logd misc_logd_file:dir { search read lock getattr write ioctl remove_name open add_name }; allow logd misc_logd_file:file { rename setattr read lock create getattr write ioctl unlink open append }; allow shell misc_logd_file:dir { search read lock getattr ioctl open }; allow shell misc_logd_file:file { read lock ioctl open getattr }; # user builds allow init misc_logd_file:dir { search setattr read create getattr write relabelfrom ioctl rmdir remove_name relabelto open add_name }; allow init misc_logd_file:file relabelto; allow init misc_logd_file:lnk_file { setattr relabelfrom create getattr relabelto unlink }; After this change: # userdebug builds allow init misc_logd_file:dir { search setattr read create getattr ioctl relabelto open }; allow init misc_logd_file:file { relabelto getattr }; allow init misc_logd_file:lnk_file relabelto; allow logd misc_logd_file:dir { search read lock getattr write ioctl remove_name open add_name }; allow logd misc_logd_file:file { rename setattr read lock create getattr write ioctl unlink open append }; allow shell misc_logd_file:dir { search read lock getattr ioctl open }; allow shell misc_logd_file:file { read lock ioctl open getattr }; # user builds allow init misc_logd_file:dir { search setattr read create getattr ioctl relabelto open }; allow init misc_logd_file:file { relabelto getattr }; allow init misc_logd_file:lnk_file relabelto; Change-Id: I0b00215049ad83182f458b4b9e258289c5144479
-
- Mar 25, 2016
-
-
Mark Salyzyn authored
(cherry pick from commit 121f5bfd) 03-25 09:31:22.996 1 1 W init : type=1400 audit(0.0:8): \ avc: denied { getattr } for path="/data/misc/logd/logcat.052" \ dev="dm-2" ino=124778 scontext=u:r:init:s0 \ tcontext=u:object_r:misc_logd_file:s0 tclass=file permissive=0 . . . Introduced a new macro not_userdebug_nor_eng() Change-Id: I9c3a952c265cac096342493598fff7d41604ca45
-
Nick Kralevich authored
There are now individual property files to control access to properties. Don't allow processes other than init to write to these property files. Change-Id: I184b9df4555ae5051f9a2ba946613c6c5d9d4403
-
Mark Salyzyn authored
03-25 09:31:22.996 1 1 W init : type=1400 audit(0.0:8): \ avc: denied { getattr } for path="/data/misc/logd/logcat.052" \ dev="dm-2" ino=124778 scontext=u:r:init:s0 \ tcontext=u:object_r:misc_logd_file:s0 tclass=file permissive=0 . . . Introduced a new macro not_userdebug_nor_eng() Change-Id: I9c3a952c265cac096342493598fff7d41604ca45
-
- Mar 11, 2016
-
-
Janis Danisevskis authored
Remove references to /data/security and the corresponding type securitly_file. Bug: 26544104 Change-Id: Iac00c293daa6b781a24c2bd4c12168dfb1cceac6
-
- Mar 10, 2016
-
-
dcashman authored
Many permissions were removed from untrusted_app by the removal of domain_deprecated, including procfs access. procfs file access was restored, however, but not completely. Add the ability to getattr to all domains, so that other domains which lost domain_deprecated may benefit, as they will likely need it. Bug: 27249037 Change-Id: Id3f5e6121548b29d739d5e0fa6ccdbc9f0fc29be
-