Bug 2507393 - SELinux is blocking systemd-tpm2-setup.service
Summary: SELinux is blocking systemd-tpm2-setup.service
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 44
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-27 02:01 UTC by buubuu5456
Modified: 2026-08-28 06:12 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description buubuu5456 2026-07-27 02:01:40 UTC
On Fedora 44, migrated to systemd-boot with a UKI (using Ukify and Dracut).
systemd-tpm2-setup.service fails to start due to the following errors:
Failed to write anchor secret file to '/boot/efi/loader/credentials/nvpcr-anchor.Fedora.cred': Permission denied

ausearch yields the following:
----
time->Sun Jul 26 21:53:50 2026
type=AVC msg=audit(1785117230.162:1089): avc:  denied  { write } for  pid=16740 comm="systemd-tpm2-se" name="tpm2-measure.log" dev="tmpfs" ino=83 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=file permissive=0
----
time->Sun Jul 26 21:53:50 2026
type=AVC msg=audit(1785117230.163:1090): avc:  denied  { write } for  pid=16740 comm="systemd-tpm2-se" name="tpm2-measure.log" dev="tmpfs" ino=83 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=file permissive=0
----
time->Sun Jul 26 21:53:51 2026
type=AVC msg=audit(1785117231.466:1091): avc:  denied  { create } for  pid=16740 comm="systemd-tpm2-se" name=".#nvpcr-anchor.Fedora.cred06da5f64f749a070" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:dosfs_t:s0 tclass=file permissive=0

sealert provides additional information:
SELinux is preventing systemd-tpm2-se from write access on the file tpm2-measure.log.
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:syslogd_var_run_t:s0
Target Objects                tpm2-measure.log [ file ]
Source                        systemd-tpm2-se
Source Path                   systemd-tpm2-se
Port                          <Unknown>
Host                          fedora-e14
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-44.4-1.fc44.noarch
Local Policy RPM              selinux-policy-targeted-44.4-1.fc44.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing

SELinux is preventing systemd-tpm2-se from create access on the file .#nvpcr-anchor.Fedora.cred06da5f64f749a070.
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:dosfs_t:s0
Target Objects                .#nvpcr-anchor.Fedora.cred06da5f64f749a070 [ file
                              ]
Source                        systemd-tpm2-se
Source Path                   systemd-tpm2-se
Port                          <Unknown>
Host                          fedora-e14
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-44.4-1.fc44.noarch
Local Policy RPM              selinux-policy-targeted-44.4-1.fc44.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing

sealert does provide options for providing permissions for this to work, however I'm not certain this should be enabled for the whole context of system_u:system_r:init_t:s0, or if this should only be allowed for this particular service. 
For context, systemd-tpm2-setup-early.service does appear to be running without issue. 

Reproducible: Always



Expected Results:
I'm not certain if the whole context should have access, or just this service, however it does seem systemd-tpm2-setup.service should have access to write the log file and nvpcr.


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