1 |
commit: c307ecefdf832e0c77ea2ffce048b4818f7a09ec |
2 |
Author: Yi Zhao <yi.zhao <AT> windriver <DOT> com> |
3 |
AuthorDate: Wed Jul 8 06:38:55 2020 +0000 |
4 |
Commit: Kenton Groombridge <concord <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 2 14:06:49 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=c307ecef |
7 |
|
8 |
sysnetwork: allow systemd_networkd_t to read link file |
9 |
|
10 |
Per https://systemd.network/systemd.network.html, we can create a |
11 |
symlink pointing to /dev/null for systemd network configuration file. |
12 |
For example: |
13 |
$ ls -l /etc/systemd/network/80-wired.network |
14 |
lrwxrwxrwx. 1 root root 9 Mar 9 2022 /etc/systemd/network/80-wired.network -> /dev/null |
15 |
|
16 |
Fixes: |
17 |
avc: denied { read } for pid=211 comm="systemd-network" |
18 |
name="80-wired.network" dev="vda" ino=1477 |
19 |
scontext=system_u:system_r:systemd_networkd_t:s0-s15:c0.c1023 |
20 |
tcontext=system_u:object_r:net_conf_t:s0 tclass=lnk_file permissive=0 |
21 |
|
22 |
systemd-networkd[211]: Failed to load /etc/systemd/network/80-wired.network, ignoring: Permission denied |
23 |
|
24 |
Signed-off-by: Yi Zhao <yi.zhao <AT> windriver.com> |
25 |
Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org> |
26 |
|
27 |
policy/modules/system/sysnetwork.if | 1 + |
28 |
1 file changed, 1 insertion(+) |
29 |
|
30 |
diff --git a/policy/modules/system/sysnetwork.if b/policy/modules/system/sysnetwork.if |
31 |
index 2598c7adc..77c175970 100644 |
32 |
--- a/policy/modules/system/sysnetwork.if |
33 |
+++ b/policy/modules/system/sysnetwork.if |
34 |
@@ -349,6 +349,7 @@ interface(`sysnet_read_config',` |
35 |
files_search_runtime($1) |
36 |
allow $1 net_conf_t:dir list_dir_perms; |
37 |
allow $1 net_conf_t:file read_file_perms; |
38 |
+ allow $1 net_conf_t:lnk_file read_lnk_file_perms; |
39 |
|
40 |
ifdef(`distro_debian',` |
41 |
files_search_runtime($1) |