Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2048521

Summary: CentOS 9 Stream: boot hangs with avc: denied when using a LUKS encrypted filesystem
Product: Red Hat Enterprise Linux 9 Reporter: Stefan Krüger <stadtkind2>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: CentOS StreamCC: bstinson, jwboyer, lvrabec, mmalik, ssekidde
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-34.1.23-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:50:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Krüger 2022-01-31 12:38:17 UTC
Description of problem:

I can't insert the password for my LUKS encrypted /home, it just hangs on the serial console with the following messages:

[  OK  ] Found device /dev/cs/home.
         Starting Cryptography Setup for home...
[   10.360447] audit: type=1400 audit(1643631406.972:4): avc:  denied  { watch watch_reads } for  pid=771 comm="systemd-tty-ask" path="/dev/tty1" dev="devtmpfs" ino=20 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file permissive=0
[   10.380787] audit: type=1400 audit(1643631406.985:5): avc:  denied  { watch watch_reads } for  pid=772 comm="systemd-tty-ask" path="/dev/ttyS0" dev="devtmpfs" ino=90 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file permissive=0

Version-Release number of selected component (if applicable):

CentOS 9 Stream as of 2022-01-31

How reproducible:

Happens every time.

Steps to Reproduce:
1. Encrypt the /home filesystem with LUKS:

cryptsetup luksFormat /dev/mapper/cs-home
cryptsetup luksOpen /dev/mapper/cs-home crypthome
mkfs.xfs /dev/mapper/crypthome
echo 'crypthome /dev/cs/home' >> /etc/crypttab
echo '/dev/mapper/crypthome /home xfs defaults 0 0' >> /etc/fstab
systemctl reboot

Actual results:

see description

Expected results:

Being able to type the LUKS passphrase

Additional info:

Comment 1 Stefan Krüger 2022-01-31 13:00:55 UTC
SELinux Version:

selinux-policy-34.1.22-1.el9.noarch
selinux-policy-targeted-34.1.22-1.el9.noarch

Comment 2 Zdenek Pytela 2022-01-31 13:06:47 UTC
Commit to backport:
commit a246a874d4c19e6cf5008cf5cf3c36475f6840f0
Author: Zdenek Pytela <zpytela>
Date:   Tue Sep 21 20:56:22 2021 +0200

    Allow scripts to enter LUKS password

Comment 8 Stefan Krüger 2022-03-21 19:55:06 UTC
Booting with a LUKS encrypted /home works fine now. Thanks!

Comment 10 errata-xmlrpc 2022-05-17 15:50:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: selinux-policy), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3918