Add new perfmon capability2 and use it
There are probably more cases but this one blocks presubmit
for cuttlefish with mainline kernels.
Bug: 158304247
Change-Id: I6d769b16a230a113a804df61f8de4dcbce2193b6
diff --git a/private/init.te b/private/init.te
index b0e7f80..7a2e0b3 100644
--- a/private/init.te
+++ b/private/init.te
@@ -51,6 +51,7 @@
# kernels that precede the perf_event_open hooks (Android common kernels 4.4
# and 4.9).
allow init self:perf_event { open cpu };
+allow init self:global_capability2_class_set perfmon;
neverallow init self:perf_event { kernel tracepoint read write };
dontaudit init self:perf_event { kernel tracepoint read write };