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