View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000477 | AlmaLinux-9 | selinux-policy | public | 2024-09-03 19:12 | 2024-09-03 19:20 |
| Reporter | pseud | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | new | Resolution | open | ||
| Platform | x86_64 | OS | GNU/Linux | OS Version | el9_4 |
| Summary | 0000477: selinux relabels resolv.conf net_conf_t to etc_t on ever suspend/ wake cycle | ||||
| Description | selinux relabels resolv.conf net_conf_t to etc_t on ever suspend/ wake cycle causing errors on network connection: 'SELinux is preventing /usr/sbin/NetworkManager from unlink access on the file resolv.conf.' | ||||
| Steps To Reproduce | 1/ suspend 2/ wake 3/ connect to network | ||||
| Tags | No tags attached. | ||||
|
|
SETroubleshoot text attached SETroubleshoot.txt (3,465 bytes)
SELinux is preventing /usr/sbin/NetworkManager from unlink access on the file resolv.conf.
***** Plugin restorecon (94.8 confidence) suggests ************************
If you want to fix the label.
resolv.conf default label should be net_conf_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v resolv.conf
***** Plugin catchall_labels (5.21 confidence) suggests *******************
If you want to allow NetworkManager to have unlink access on the resolv.conf file
Then you need to change the label on resolv.conf
Do
# semanage fcontext -a -t FILE_TYPE 'resolv.conf'
where FILE_TYPE is one of the following: NetworkManager_etc_rw_t, NetworkManager_tmp_t, NetworkManager_var_lib_t, NetworkManager_var_run_t, dhcpc_state_t, dhcpc_var_run_t, dnsmasq_var_run_t, hostname_etc_t, krb5_host_rcache_t, named_cache_t, net_conf_t, pppd_var_run_t, ssh_home_t, systemd_passwd_var_run_t.
Then execute:
restorecon -v 'resolv.conf'
***** Plugin catchall (1.44 confidence) suggests **************************
If you believe that NetworkManager should be allowed unlink access on the resolv.conf file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'NetworkManager' --raw | audit2allow -M my-NetworkManager
# semodule -X 300 -i my-NetworkManager.pp
Additional Information:
Source Context system_u:system_r:NetworkManager_t:s0
Target Context system_u:object_r:etc_t:s0
Target Objects resolv.conf [ file ]
Source NetworkManager
Source Path /usr/sbin/NetworkManager
Port <Unknown>
Host oldmachine
Source RPM Packages NetworkManager-1.46.0-13.el9_4.x86_64
Target RPM Packages
SELinux Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch
Local Policy RPM selinux-policy-targeted-38.1.35-2.el9_4.2.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name oldmachine
Platform Linux oldmachine
5.14.0-427.16.1.el9_4.x86_64 #1 SMP
PREEMPT_DYNAMIC Thu May 9 18:15:59 EDT 2024 x86_64
x86_64
Alert Count 14
First Seen 2024-09-02 07:33:51 BST
Last Seen 2024-09-03 19:58:39 BST
Local ID 5f646ea4-8e76-41fb-b0f7-7cab4e2d9c01
Raw Audit Messages
type=AVC msg=audit(1725389919.934:1114): avc: denied { unlink } for pid=1337 comm="NetworkManager" name="resolv.conf" dev="dm-1" ino=527389 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=0
type=SYSCALL msg=audit(1725389919.934:1114): arch=x86_64 syscall=rename success=no exit=EACCES a0=563de8727120 a1=563de698ffe8 a2=0 a3=31 items=0 ppid=1 pid=1337 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=NetworkManager exe=/usr/sbin/NetworkManager subj=system_u:system_r:NetworkManager_t:s0 key=(null)
Hash: NetworkManager,NetworkManager_t,etc_t,file,unlink
|