Bug 2346950

Summary: run0 dnf --help fails: SELinux is preventing (dnf) from entrypoint access on the file /usr/bin/dnf5.
Product: [Fedora] Fedora Reporter: Michel Lind <michel>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: dwalsh, lvrabec, mmalik, mueller_fedora, omosnacek, pkoncity, vg.aetera, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-09-03 10:14:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michel Lind 2025-02-21 03:35:56 UTC
SELinux is preventing (dnf) from entrypoint access on the file /usr/bin/dnf5.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that (dnf) should be allowed entrypoint access on the dnf5 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 '(dnf)' --raw | audit2allow -M my-dnf
# semodule -X 300 -i my-dnf.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:unconfined_t:s0-
                              s0:c0.c1023
Target Context                system_u:object_r:rpm_exec_t:s0
Target Objects                /usr/bin/dnf5 [ file ]
Source                        (dnf)
Source Path                   (dnf)
Port                          <Unknown>
Host                          mimi
Source RPM Packages           
Target RPM Packages           dnf5-5.2.10.0-2.fc41.x86_64
SELinux Policy RPM            selinux-policy-targeted-41.33-1.fc41.noarch
Local Policy RPM              selinux-policy-targeted-41.33-1.fc41.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     mimi
Platform                      Linux mimi 6.12.11-200.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Jan 24 04:59:58 UTC 2025
                              x86_64
Alert Count                   3
First Seen                    2025-02-20 21:29:35 CST
Last Seen                     2025-02-20 21:31:50 CST
Local ID                      f2a5cc19-762f-4029-87c5-4bb5fd419ff7

Raw Audit Messages
type=AVC msg=audit(1740108710.318:1057): avc:  denied  { entrypoint } for  pid=21292 comm="(dnf)" path="/usr/bin/dnf5" dev="dm-0" ino=1061953 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:rpm_exec_t:s0 tclass=file permissive=0


Hash: (dnf),unconfined_t,rpm_exec_t,file,entrypoint


Reproducible: Always

Steps to Reproduce:
1. run0 dnf --help

Actual Results:  
The terminal just displays a new prompt; error code is 203

Expected Results:  
dnf --help result printed


Also happens if I do `run0 dnf5 --help` instead of `run0 dnf --help`. Using `sudo` instead of `run0` works

(I know I don't need to use `sudo` or `run0` to display the help, but it's just a quick repro - same behavior if I try to do `dnf upgrade`)

Comment 1 Marcus Müller 2025-09-03 10:06:34 UTC
- Note that the same also happens when explicitly running dnf**5**, i.e., `run0 dnf5 --help`.
- still present on Fedora 42 
- Since this affects a core component and run0, which is probably (long-term) a recommendable sudo alternative, I'll add dnf itself as affected component; "runnable using usual privilege acquisition processes" should probably be part of its testing landscape

Comment 2 Marcus Müller 2025-09-03 10:14:04 UTC

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