Bug 2086926

Summary: SELinux is preventing charon from 'getattr' accesses on the chr_file /dev/tpmrm0.
Product: [Fedora] Fedora Reporter: Mai Ling <mailinglists35>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 36CC: cirelli94+fedora, dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, pkoncity, r3pek, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:368473f983706adc9c7f3c30f53a95732ca06b464456f0d73bae306b85157e6b;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-36.15-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-22 01:17:20 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 Mai Ling 2022-05-16 19:51:43 UTC
Description of problem:
SELinux is preventing charon from 'getattr' accesses on the chr_file /dev/tpmrm0.

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

If you believe that charon should be allowed getattr access on the tpmrm0 chr_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 'charon' --raw | audit2allow -M my-charon
# semodule -X 300 -i my-charon.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:object_r:tpm_device_t:s0
Target Objects                /dev/tpmrm0 [ chr_file ]
Source                        charon
Source Path                   charon
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.8-2.fc36.noarch
Local Policy RPM              selinux-policy-targeted-36.8-2.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.17.6-300.fc36.x86_64 #1 SMP
                              PREEMPT Mon May 9 15:47:11 UTC 2022 x86_64 x86_64
Alert Count                   1
First Seen                    2022-05-16 22:29:21 EEST
Last Seen                     2022-05-16 22:29:21 EEST
Local ID                      f022d832-e285-4773-a980-72599bbe2ef6

Raw Audit Messages
type=AVC msg=audit(1652729361.214:334): avc:  denied  { getattr } for  pid=1642 comm="charon" path="/dev/tpmrm0" dev="devtmpfs" ino=135 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:tpm_device_t:s0 tclass=chr_file permissive=0


Hash: charon,ipsec_t,tpm_device_t,chr_file,getattr

Version-Release number of selected component:
selinux-policy-targeted-36.8-2.fc36.noarch

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

Potential duplicate: bug 2018827

Comment 1 Zdenek Pytela 2022-05-17 10:22:26 UTC
Hi,

Do you happen to know at which moment this denial appears?

Comment 2 Zdenek Pytela 2022-05-17 10:23:14 UTC
*** Bug 2018827 has been marked as a duplicate of this bug. ***

Comment 3 Zdenek Pytela 2022-06-01 08:00:21 UTC
*** Bug 2092249 has been marked as a duplicate of this bug. ***

Comment 4 Zdenek Pytela 2022-06-01 08:00:39 UTC
*** Bug 2026328 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Pytela 2022-07-27 13:32:30 UTC
Mai Ling,

Can you try your scenario in SELinux permissive mode to gather all subsequent denials?

  # setenforce 0
<reproduce>
  # setenforce 1
  # ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts today

Comment 6 Fedora Update System 2022-09-14 16:32:59 UTC
FEDORA-2022-096f7730be has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-096f7730be

Comment 7 Fedora Update System 2022-09-15 02:21:27 UTC
FEDORA-2022-096f7730be 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-096f7730be`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-096f7730be

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

Comment 8 Fedora Update System 2022-09-22 01:17:20 UTC
FEDORA-2022-096f7730be has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Red Hat Bugzilla 2023-09-18 04:37:16 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days