Blame SOURCES/0008-selinux-policy-allow-custodia-to-access-proc-cpuinfo_rhbz#1998129.patch

0ac888
From 07e2bf732f54f936cccc4e0c7b468d77f97e911a Mon Sep 17 00:00:00 2001
0ac888
From: Florence Blanc-Renaud <flo@redhat.com>
0ac888
Date: Mon, 30 Aug 2021 18:40:24 +0200
0ac888
Subject: [PATCH] selinux policy: allow custodia to access /proc/cpuinfo
0ac888
0ac888
On aarch64, custodia creates AVC when accessing /proc/cpuinfo.
0ac888
0ac888
According to gcrypt manual
0ac888
(https://gnupg.org/documentation/manuals/gcrypt/Configuration.html),
0ac888
/proc/cpuinfo is used on ARM architecture to read the hardware
0ac888
capabilities of the CPU. This explains why the issue happens only
0ac888
on aarch64.
0ac888
0ac888
audit2allow suggests to add the following:
0ac888
allow ipa_custodia_t proc_t:file { getattr open read };
0ac888
0ac888
but this policy would be too broad. Instead, the patch is using
0ac888
the interface kernel_read_system_state.
0ac888
0ac888
Fixes: https://pagure.io/freeipa/issue/8972
0ac888
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
0ac888
Reviewed-By: Christian Heimes <cheimes@redhat.com>
0ac888
---
0ac888
 selinux/ipa.te | 1 +
0ac888
 1 file changed, 1 insertion(+)
0ac888
0ac888
diff --git a/selinux/ipa.te b/selinux/ipa.te
0ac888
index 68e109419..7492fca04 100644
0ac888
--- a/selinux/ipa.te
0ac888
+++ b/selinux/ipa.te
0ac888
@@ -364,6 +364,7 @@ files_tmp_filetrans(ipa_custodia_t, ipa_custodia_tmp_t, { dir file })
0ac888
 
0ac888
 kernel_dgram_send(ipa_custodia_t)
0ac888
 kernel_read_network_state(ipa_custodia_t)
0ac888
+kernel_read_system_state(ipa_custodia_t)
0ac888
 
0ac888
 auth_read_passwd(ipa_custodia_t)
0ac888
 
0ac888
-- 
0ac888
2.31.1
0ac888