Gentoo Archives: gentoo-commits

From: Kenton Groombridge <concord@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/
Date: Wed, 02 Nov 2022 14:42:56
Message-Id: 1667398022.cec2de860f7eb541711fc5a6dc0adf873970068d.concord@gentoo
1 commit: cec2de860f7eb541711fc5a6dc0adf873970068d
2 Author: Dave Sugar <dsugar100 <AT> gmail <DOT> com>
3 AuthorDate: Sat Sep 17 02:28:33 2022 +0000
4 Commit: Kenton Groombridge <concord <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 2 14:07:02 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=cec2de86
7
8 Seeing long delay during shutdown saying: 'A stop job is running for Restore /run/initramfs on shutdown'
9
10 These were the denials in audit.log related to this
11
12 node=localhost type=AVC msg=audit(1663379349.428:5081): avc: denied { write } for pid=3594 comm="cpio" name="initramfs" dev="tmpfs" ino=18 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=1
13 node=localhost type=AVC msg=audit(1663379349.428:5081): avc: denied { add_name } for pid=3594 comm="cpio" name="bin" scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=1
14 node=localhost type=AVC msg=audit(1663379349.429:5083): avc: denied { create } for pid=3594 comm="cpio" name="dev" scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=1
15 node=localhost type=AVC msg=audit(1663379349.429:5084): avc: denied { setattr } for pid=3594 comm="cpio" name="dev" dev="tmpfs" ino=1356 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=1
16 node=localhost type=AVC msg=audit(1663379349.430:5087): avc: denied { create } for pid=3594 comm="cpio" name="systemd.conf" scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
17 node=localhost type=AVC msg=audit(1663379349.430:5087): avc: denied { write open } for pid=3594 comm="cpio" path="/run/initramfs/etc/conf.d/systemd.conf" dev="tmpfs" ino=1365 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
18 node=localhost type=AVC msg=audit(1663379349.430:5088): avc: denied { setattr } for pid=3594 comm="cpio" name="systemd.conf" dev="tmpfs" ino=1365 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
19 node=localhost type=AVC msg=audit(1663379349.834:5119): avc: denied { read } for pid=3594 comm="cpio" name="gr737d-8x16.psfu.gz" dev="tmpfs" ino=1632 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
20 node=localhost type=AVC msg=audit(1663379349.834:5119): avc: denied { link } for pid=3594 comm="cpio" name="gr737d-8x16.psfu.gz" dev="tmpfs" ino=1632 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1
21
22 Also seeing the following, but seems to function without related rules:
23
24 node=localhost type=AVC msg=audit(1663379349.428:5081): avc: denied { create } for pid=3594 comm="cpio" name="bin" scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=lnk_file permissive=1
25 node=localhost type=AVC msg=audit(1663379349.428:5082): avc: denied { setattr } for pid=3594 comm="cpio" name="bin" dev="tmpfs" ino=1355 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=lnk_file permissive=1
26 node=localhost type=AVC msg=audit(1663379349.429:5085): avc: denied { create } for pid=3594 comm="cpio" name="console" scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=chr_file permissive=1
27 node=localhost type=AVC msg=audit(1663379349.429:5086): avc: denied { setattr } for pid=3594 comm="cpio" name="console" dev="tmpfs" ino=1357 scontext=system_u:system_r:initrc_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=chr_file permissive=1
28
29 Signed-off-by: Dave Sugar <dsugar100 <AT> gmail.com>
30 Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>
31
32 policy/modules/system/init.te | 2 ++
33 1 file changed, 2 insertions(+)
34
35 diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
36 index 0c4fb9dd1..249775e52 100644
37 --- a/policy/modules/system/init.te
38 +++ b/policy/modules/system/init.te
39 @@ -1019,6 +1019,8 @@ ifdef(`distro_redhat',`
40
41 fs_read_tmpfs_symlinks(initrc_t)
42 fs_rw_tmpfs_chr_files(initrc_t)
43 + fs_manage_tmpfs_dirs(initrc_t)
44 + fs_manage_tmpfs_files(initrc_t)
45
46 storage_manage_fixed_disk(initrc_t)
47 storage_dev_filetrans_fixed_disk(initrc_t)