From c75aa50d5df4d148d4a6c4f9ab445acb72c4f4a4 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep <jeffv@google.com> Date: Mon, 26 Jun 2017 09:38:21 -0700 Subject: [PATCH] Add another extraneous neverallow rule to force attribute inclusion Due to the massively increased number of attributes in SELinux policy as part of the treble changes, we have had to remove attributes from policy for performance reasons. Unfortunately, some attributes are required to be in policy to ensure that our neverallow rules are being properly enforced. Usually this is not a problem, since neverallow rules indicate that an attribute should be kept, but this is not currently the case when the attribute is part of a negation in a group. This is particularly problematic with treble since some attributes may exist for HALs that have no implementation, and thus no types. In particular, this has caused an issue with the neverallows added in our macros. Add an extraneous neverallow rule to each of those auto-generated neverallow rules to make sure that they are not removed from policy, until the policy compiler is fixed to avoid this. Also add corresponding rules for other types which have been removed due to no corresponding rules. Bug: 62658302 Bug: 62999603 Test: Build Marlin policy. Test: verify attribute exists in policy using sepolicy-analyze. sepolicy-analyze $OUT/vendor/etc/selinux/precompiled_sepolicy \ attribute hal_tetheroffload_server Test: CTS neverallow tests pass. cts-tradefed run cts -m CtsSecurityHostTestCases -t \ android.cts.security.SELinuxNeverallowRulesTest Change-Id: I62596ba8198ffdcbb4315df639a834e4becaf249 --- public/hal_neverallows.te | 1 + 1 file changed, 1 insertion(+) diff --git a/public/hal_neverallows.te b/public/hal_neverallows.te index 036e1d2dc..fc2b5f630 100644 --- a/public/hal_neverallows.te +++ b/public/hal_neverallows.te @@ -17,6 +17,7 @@ neverallow { -hal_wifi_supplicant_server -rild } domain:{ tcp_socket udp_socket rawip_socket } *; +neverallow hal_tetheroffload_server unlabeled:service_manager list; #TODO: b/62658302 ### # HALs are defined as an attribute and so a given domain could hypothetically -- GitLab