Bug 2270733 - SELinux denial for dhcpcd in /var/run/netns
Summary: SELinux denial for dhcpcd in /var/run/netns
Keywords:
Status: CLOSED DUPLICATE of bug 2269708
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-03-21 15:20 UTC by Martin Osvald 🛹
Modified: 2024-03-21 16:04 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-03-21 15:32:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Osvald 🛹 2024-03-21 15:20:39 UTC
Description of problem:

While writing a CI test for Kea I came to notice about SELinux denial for dhcpcd when run under non default network namespace. Dhcpcd tries to detect whether it runs under network namespace and if so it reads the name of it and just prints it for logging/informative purposes. This prevents CI tests to pass cleanly.

Version-Release number of selected component (if applicable):

selinux-policy-40.15-1.fc41.noarch

How reproducible:

Always.

Steps to Reproduce:
1. run dhcpcd under non-default network namespace
# ip netns exec netns-client dhcpcd -4 --inactive -B --nohook 20-resolv.conf veth1

Actual results:

~~~
[ ERROR ] AVC check: FAIL
----
type=AVC msg=audit(03/21/2024 10:44:52.504:650) : avc:  denied  { read } for  pid=3762 comm=dhcpcd name=netns dev="tmpfs" ino=1407 scontext=unconfined_u:system_r:dhcpc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:ifconfig_var_run_t:s0 tclass=dir permissive=0
~~~

Expected results:

No denials.

Additional info:

strace:

6569  10:47:50.521190 openat(AT_FDCWD</>, "/var/run/netns", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 EACCES (Permission denied) <0.000204>

dhcpd code:

https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/if-linux.c#L406

Comment 1 Zdenek Pytela 2024-03-21 15:32:08 UTC

*** This bug has been marked as a duplicate of bug 2269708 ***

Comment 2 Martin Osvald 🛹 2024-03-21 15:39:13 UTC
Oh sorry! I forgot to check existing BZs.

Comment 3 Zdenek Pytela 2024-03-21 16:04:08 UTC
np, it is quite fresh, not even in a build


Note You need to log in before you can comment on or make changes to this bug.