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

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