Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2093285 - SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /run/ddclient/ddclient.pid.
Summary: SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /run/...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 36
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c7fd5aa65c29f15b115f32d0b46...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-03 12:46 UTC by Davide Repetto
Modified: 2022-08-05 01:34 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-36.13-3.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-05 01:34:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1230 0 None open Allow nm-dispatcher custom plugin create and use unix dgram socket 2022-06-15 18:38:43 UTC

Description Davide Repetto 2022-06-03 12:46:31 UTC
Description of problem:
Description of the problem:
==========================
This AVC happens at boot, even after "fixfiles onboot"

here are the denials data in in full auditing mode.

# ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts recent
----
type=PROCTITLE msg=audit(03/06/2022 14:23:34.678:235) : proctitle=/usr/libexec/ksmctl start 
type=PATH msg=audit(03/06/2022 14:23:34.678:235) : item=1 name=/sys/kernel/mm/ksm/run inode=5435 dev=00:17 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=PATH msg=audit(03/06/2022 14:23:34.678:235) : item=0 name=/sys/kernel/mm/ksm/ inode=5432 dev=00:17 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(03/06/2022 14:23:34.678:235) : cwd=/ 
type=SYSCALL msg=audit(03/06/2022 14:23:34.678:235) : arch=x86_64 syscall=openat success=yes exit=3 a0=AT_FDCWD a1=0x558a0ea3603f a2=O_WRONLY|O_CREAT|O_TRUNC a3=0x1b6 items=2 ppid=1 pid=1153 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ksmctl exe=/usr/libexec/ksmctl subj=system_u:system_r:ksm_t:s0 key=(null) 
type=AVC msg=audit(03/06/2022 14:23:34.678:235) : avc:  denied  { create } for  pid=1153 comm=ksmctl name=run scontext=system_u:system_r:ksm_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=1 
type=AVC msg=audit(03/06/2022 14:23:34.678:235) : avc:  denied  { add_name } for  pid=1153 comm=ksmctl name=run scontext=system_u:system_r:ksm_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1 
type=AVC msg=audit(03/06/2022 14:23:34.678:235) : avc:  denied  { write } for  pid=1153 comm=ksmctl name=ksm dev="sysfs" ino=5432 scontext=system_u:system_r:ksm_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1 
----
SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /run/ddclient/ddclient.pid.

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

Se ci credi bash dovrebbe essere consentito getattr accesso al ddclient.pid file per impostazione predefinita.
Then si dovrebbe riportare il problema come bug.
E' possibile generare un modulo di politica locale per consentire questo accesso.
Do
consentire questo accesso per ora eseguendo:
# ausearch -c '50-ddclient' --raw | audit2allow -M my-$MODULE_NOME
# semodule -X 300 -i miei-50ddclient.pp

Additional Information:
Source Context                system_u:system_r:NetworkManager_dispatcher_ddclie
                              nt_t:s0
Target Context                system_u:object_r:ddclient_var_run_t:s0
Target Objects                /run/ddclient/ddclient.pid [ file ]
Source                        50-ddclient
Source Path                   /usr/bin/bash
Port                          <Sconosciuto>
Host                          (removed)
Source RPM Packages           bash-5.1.16-2.fc36.x86_64
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.10-1.fc36.noarch
Local Policy RPM              selinux-policy-targeted-36.10-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.17.11-300.fc36.x86_64 #1 SMP
                              PREEMPT Wed May 25 15:04:05 UTC 2022 x86_64 x86_64
Alert Count                   1
First Seen                    2022-06-03 14:14:27 CEST
Last Seen                     2022-06-03 14:14:27 CEST
Local ID                      f22351b0-58f5-4405-90a7-cde00a8625bf

Raw Audit Messages
type=AVC msg=audit(1654258467.499:355): avc:  denied  { getattr } for  pid=2950 comm="50-ddclient" path="/run/ddclient/ddclient.pid" dev="tmpfs" ino=2502 scontext=system_u:system_r:NetworkManager_dispatcher_ddclient_t:s0 tcontext=system_u:object_r:ddclient_var_run_t:s0 tclass=file permissive=1


type=SYSCALL msg=audit(1654258467.499:355): arch=x86_64 syscall=newfstatat success=yes exit=0 a0=ffffff9c a1=55faaebd9ef0 a2=7ffe3fe803b0 a3=0 items=1 ppid=2934 pid=2950 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=50-ddclient exe=/usr/bin/bash subj=system_u:system_r:NetworkManager_dispatcher_ddclient_t:s0 key=(null)

type=CWD msg=audit(1654258467.499:355): cwd=/

type=PATH msg=audit(1654258467.499:355): item=0 name=/run/ddclient/ddclient.pid inode=2502 dev=00:1a mode=0100644 ouid=987 ogid=984 rdev=00:00 obj=system_u:object_r:ddclient_var_run_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0

Hash: 50-ddclient,NetworkManager_dispatcher_ddclient_t,ddclient_var_run_t,file,getattr

Version-Release number of selected component:
selinux-policy-targeted-36.10-1.fc36.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.17.1
hashmarkername: setroubleshoot
kernel:         5.17.11-300.fc36.x86_64
type:           libreport

Comment 1 Davide Repetto 2022-06-08 07:28:58 UTC
Similar problem has been detected:

Description of the problem:
==============================
This AVC denial happens from time to time, when switching networks.
I suppose that ddclient should be allowed full access to its own temporary files by default.


hashmarkername: setroubleshoot
kernel:         5.17.12-300.fc36.x86_64
package:        selinux-policy-targeted-36.10-1.fc36.noarch
reason:         SELinux is preventing 50-ddclient from 'getattr' accesses on the file /run/ddclient/ddclient.pid.
type:           libreport

Comment 2 Fedora Update System 2022-06-30 07:25:52 UTC
FEDORA-2022-fd22b79a84 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fd22b79a84

Comment 3 Fedora Update System 2022-07-01 02:09:51 UTC
FEDORA-2022-fd22b79a84 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-fd22b79a84`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-fd22b79a84

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2022-07-16 01:12:50 UTC
FEDORA-2022-320775eb9a has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-320775eb9a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-320775eb9a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2022-08-04 02:41:53 UTC
FEDORA-2022-139ec288ca has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-139ec288ca`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-139ec288ca

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-08-05 01:34:39 UTC
FEDORA-2022-139ec288ca has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


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