Bug 2086926 - SELinux is preventing charon from 'getattr' accesses on the chr_file /dev/tpmrm0.
Summary: SELinux is preventing charon from 'getattr' accesses on the chr_file /dev/tpm...
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:368473f983706adc9c7f3c30f53...
: 2018827 2026328 2092249 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-16 19:51 UTC by Mai Ling
Modified: 2023-09-18 04:37 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-36.15-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-22 01:17:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1356 0 None open Allow ipsec_t read/write tpm devices 2022-08-31 17:03:15 UTC

Internal Links: 2147380

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


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