- Jan 18, 2017
-
-
Alex Klyubin authored
This improves readability and consistency for HAL implementation domains which have only one implementation. Test: No change to policy according to sesearch Test: No change to which types are associated with haldomain according to "sepolicy-analyze <sepolicy file> attribute haldomain" Bug: 34180936 Change-Id: Ice599ea4971cdfbd8b835b1fd02ad1e14c7a0386
-
- Jan 17, 2017
-
-
Alex Klyubin authored
This marks all HAL domain implementations with the haldomain attribute so that rules can be written which apply to all HAL implementations. This follows the pattern used for appdomain, netdomain and bluetoothdomain. Test: No change to policy according to sesearch. Bug: 34180936 Change-Id: I0cfe599b0d49feed36538503c226dfce41eb65f6
-
- Jan 10, 2017
-
-
Mikhail Naganov authored
Bug: 30222631 Change-Id: I30ad019872881e21f61a53e4397112ea0e99688b
-
- Dec 28, 2016
-
-
Richard Uhler authored
Test: make checkbuild, aosp_bullhead-userdebug boots. Bug: 33192586 Change-Id: I386df8b6c04fb162f79a4409801ce3e882026ea8
-
- Dec 22, 2016
-
-
Steven Moreland authored
Bug: 32123421 Test: full build/test of allocator hal using hidl_test Change-Id: I253b4599b6fe6e7f4a2f5f55b34cdeed9e5d769b
-
- Dec 21, 2016
-
-
Steven Moreland authored
Enabling/disabling sepolicy based on ENABLE_TREBLE is not granular enough (ref: b/32978887 #4). Bug: 32978887 Test: compiles, doesn't cause any additional denials on device. Nothing depends on these things I'm removing. Change-Id: I10acbde16e5e2093f2c9205ed79cd20caed7f44d
-
- Dec 15, 2016
-
-
Glen Kuhne authored
In order for hal clients to use IServiceManager::registerForNotifications, the hwservicemanager needs to be able to call into client processes. Test: WIP Bug: 33383725 Change-Id: I59470e9cd5cbeafda010fedc0b91eeb41280e0a1
-
- Dec 08, 2016
-
-
dcashman authored
app_domain was split up in commit: 2e00e637 to enable compilation by hiding type_transition rules from public policy. These rules need to be hidden from public policy because they describe how objects are labeled, of which non-platform should be unaware. Instead of cutting apart the app_domain macro, which non-platform policy may rely on for implementing new app types, move all app_domain calls to private policy. (cherry-pick of commit: 76035ea0) Bug: 33428593 Test: bullhead and sailfish both boot. sediff shows no policy change. Change-Id: I4beead8ccc9b6e13c6348da98bb575756f539665
-
- Dec 06, 2016
-
-
dcashman authored
In order to support platform changes without simultaneous updates from non-platform components, the platform and non-platform policies must be split. In order to provide a guarantee that policy written for non-platform objects continues to provide the same access, all types exposed to non-platform policy are versioned by converting them and the policy using them into attributes. This change performs that split, the subsequent versioning and also generates a mapping file to glue the different policy components together. Test: Device boots and runs. Bug: 31369363 Change-Id: Ibfd3eb077bd9b8e2ff3b2e6a0ca87e44d78b1317
-
- Nov 28, 2016
-
-
Nick Kralevich authored
Never used. Test: policy compiles. Change-Id: I0ce6c46bb05925a4b3eda83531b28f873b0c9b99
-
- Nov 23, 2016
-
-
Nick Kralevich authored
In particular, get rid of TIOCSTI, which is only ever used for exploits. http://www.openwall.com/lists/oss-security/2016/09/26/14 Bug: 33073072 Bug: 7530569 Test: "adb shell" works Test: "adb install package" works Test: jackpal terminal emulator from https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en works Change-Id: I96b5e7059d106ce57ff55ca6e458edf5a4c393bf
-
- Nov 21, 2016
-
-
Nick Kralevich authored
Description stolen from https://github.com/torvalds/linux/commit/42a9699a9fa179c0054ea3cf5ad3cc67104a6162 Remove unused permission definitions from SELinux. Many of these were only ever used in pre-mainline versions of SELinux, prior to Linux 2.6.0. Some of them were used in the legacy network or compat_net=1 checks that were disabled by default in Linux 2.6.18 and fully removed in Linux 2.6.30. Permissions never used in mainline Linux: file swapon filesystem transition tcp_socket { connectto newconn acceptfrom } node enforce_dest unix_stream_socket { newconn acceptfrom } Legacy network checks, removed in 2.6.30: socket { recv_msg send_msg } node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send } netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send } Test: policy compiles and no boot errors (marlin) Change-Id: Idaef2567666f80db39c3e3cee70e760e1dac73ec
-
Jorge Lucangeli Obes authored
|WITH_DEXPREOPT_PIC = false| will still cause code to be loaded from /data. Bug: 32970029 Test: On HiKey and Marlin: Test: Add |WITH_DEXPREOPT_PIC = false|, see SELinux denial. Test: Apply this CL, no SELinux denials. Change-Id: I0a1d39eeb4d7f75d84c1908b879d9ea1ccffba74
-
- Nov 18, 2016
-
-
Jorge Lucangeli Obes authored
When WITH_DEXPREOPT is set, the zygote does not need to execute dalvikcache_data_file objects. Bug: 32970029 Test: Add policy line inside macro, build with and without WITH_DEXPREOPT. Test: HiKey builds, boots, no zygote denials. Change-Id: I4dace93e8044267232f0f26cfe427fc250d351fb
-
- Oct 26, 2016
-
-
Jeff Vander Stoep authored
Test: builds Bug: 32243668 Change-Id: I1ad4b53003462e932cf80b6972db1520dc66d735
-
- Oct 19, 2016
-
-
Jeff Vander Stoep authored
Test: builds Change-Id: Idd1d90a89a9ecbb2738d6b483af0e8479e87aa15
-
- Oct 06, 2016
-
-
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
-
- Sep 14, 2016
-
-
Martijn Coenen authored
Add a macro to make this easier for other processes as well. Change-Id: I489d0ce042fe5ef88dc767a6fbdb9b795be91601 (cherry picked from commit c2b9c1561e4bd7ac86d78b44ca7927994e781da0)
-
- Sep 10, 2016
-
-
Jeff Vander Stoep authored
Grant permissions observed. Bug: 28760354 Change-Id: Ie63cda709319bbf635ef7bffbba3477c2cccc11b
-
- Aug 29, 2016
-
-
Jeff Vander Stoep authored
Grant permissions observed. (cherry picked from commit 9c820a11) Merged-in: Ifdead51f873eb587556309c48fb84ff1542ae303 Bug: 28760354 Change-Id: Ifdead51f873eb587556309c48fb84ff1542ae303
-
- Aug 04, 2016
-
-
William Roberts authored
boolean and setenforce macros are not used in base policy and cannot be used in any policy, since they violate neverallow rules. Remove these from the policy. Change-Id: Icc0780eaf06e95af36306031e1f615b05cb79869 Signed-off-by:
William Roberts <william.c.roberts@intel.com>
-
- Apr 23, 2016
-
-
Nick Kralevich authored
When using domain_trans(init, foo_exec, foo), don't add the following rule: allow foo init:process sigchld; This is already allowed for all domains in domain.te: # Allow reaping by init. allow domain init:process sigchld; So adding it over and over again is redundant and bloats the policy. More specifically, when I run: sepolicy-analyze out/target/product/bullhead/root/sepolicy dups this change reduces the number of duplicate policy statements from 461 to 389. Change-Id: I8632e5649a54f63eb1f79ea6405c4b3f515f544c
-
- 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
-
- 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
-
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
-
- Jan 26, 2016
-
-
SimHyunYong authored
This macro does not give us anything to it. Change-Id: Ie0b56716cc0144f0a59849647cad31e06a25acf1
-
- Dec 08, 2015
-
-
Nick Kralevich authored
Instead of allowing global read access to all properties, only allow read access to the properties which are part of core SELinux policy. Device-specific policies are no longer readable by default and need to be granted in device-specific policy. Grant read-access to any property where the person has write access. In most cases, anyone who wants to write a property needs read access to that property. Change-Id: I2bd24583067b79f31b3bb0940b4c07fc33d09918
-
- Dec 03, 2015
-
-
Tom Cherry authored
Properties are now broken up from a single /dev/__properties__ file into multiple files, one per property label. This commit provides the mechanism to control read access to each of these files and therefore sets of properties. This allows full access for all domains to each of these new property files to match the current permissions of /dev/__properties__. Future commits will restrict the access. Bug: 21852512 Change-Id: Ie9e43968acc7ac3b88e354a0bdfac75b8a710094
-
- Sep 01, 2015
-
-
Jeff Vander Stoep authored
Remove system server's permission 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: I3c64d64359060561102e1587531836b69cfeef00
-
- Aug 24, 2015
-
-
Nick Kralevich authored
On user and userdebug builds, system_server only loads executable content from /data/dalvik_cache and /system. JITing for system_server is only supported on eng builds. Remove the rules for user and userdebug builds. Going forward, the plan of record is that system_server will never use JIT functionality, instead using dex2oat or interpreted mode. Inspired by https://android-review.googlesource.com/98944 Change-Id: I54515acaae4792085869b89f0d21b87c66137510
-
- Jun 23, 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. (cherry picked from e2651972) Bug: 21242418 Change-Id: If01c8001084575e7441253f0fa8b4179ae33f534
-
- Jun 08, 2015
-
-
dcashman authored
service_manager_local_audit_domain was used to fine tune the service_manager auditallow rules when introducing the service_manager SELinux rules. This is no longer needed. Bug: 21656807 Change-Id: Ia042a887e7bf9eb2a2b08b8d831e68dfe6395f75
-
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
- May 14, 2015
-
-
William Roberts authored
Encourage the use of set_prop macro by making existing unix_socket_connect(domain, property, init) calls warn at compile time. When encountering one of these macros, m4 will emit a deprecated message as follows: m4: external/sepolicy/adbd.te: 97: deprecated: unix_socket_connect(adbd, property, init) Please use set_prop(adbd, <property name>) instead. Change-Id: I997fed75d2683933e08db8b9efeecea71523c7c3 Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-
- May 07, 2015
-
-
William Roberts authored
A common source of mistakes when authoring sepolicy is properly setting up property sets. This is a 3 part step of: 1. Allowing the unix domain connection to the init/property service 2. Allowing write on the property_socket file 3. Allowing the set on class property_service The macro unix_socket_connect() handled 1 and 2, but could be confusing for first time policy authors. 3 had to be explicitly added. To correct this, we introduce a new macros: set_prop(sourcedomain, targetprop) This macro handles steps 1, 2 and 3. No difference in sediff is expected. (cherrypicked from commit 625a3526) Change-Id: I630ba0178439c935d08062892990d43a3cc1239e Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-
William Roberts authored
A common source of mistakes when authoring sepolicy is properly setting up property sets. This is a 3 part step of: 1. Allowing the unix domain connection to the init/property service 2. Allowing write on the property_socket file 3. Allowing the set on class property_service The macro unix_socket_connect() handled 1 and 2, but could be confusing for first time policy authors. 3 had to be explicitly added. To correct this, we introduce a new macros: set_prop(sourcedomain, targetprop) This macro handles steps 1, 2 and 3. No difference in sediff is expected. Change-Id: I630ba0178439c935d08062892990d43a3cc1239e Signed-off-by:
William Roberts <william.c.roberts@linux.intel.com>
-