From 8398b1833c1168ac30ef8e13db39f50c187503cb Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Thu, 14 Apr 2022 18:37:38 +0200
Subject: [PATCH] Allow systemd-gpt-auto-generator create and use
 netlink_kobject_uevent_socket

Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/8398b1833c1168ac30ef8e13db39f50c187503cb
Conflict: NA

Addresses the following AVC denial:
type=AVC msg=audit(1649951765.765:599): avc:  denied  { create } for  pid=35143 comm="systemd-gpt-aut" scontext=system_u:system_r:systemd_gpt_generator_t:s0 tcontext=system_u:system_r:systemd_gpt_generator_t:s0 tclass=netlink_kobject_uevent_socket permissive=0

Resolves: rhbz#2075589
Signed-off-by: lujie54 <lujie54@huawei.com>
---
 policy/modules/system/systemd.te | 1 +
 1 file changed, 1 insertion(+)

diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
index 8fe3eb9..a9308b8 100644
--- a/policy/modules/system/systemd.te
+++ b/policy/modules/system/systemd.te
@@ -1106,6 +1106,7 @@ systemd_read_efivarfs(systemd_hwdb_t)
 #
 
 allow systemd_gpt_generator_t self:capability sys_rawio;
+allow systemd_gpt_generator_t self:netlink_kobject_uevent_socket create_socket_perms;
 
 dev_read_sysfs(systemd_gpt_generator_t)
 dev_write_kmsg(systemd_gpt_generator_t)
-- 
1.8.3.1

