Skip to content

Commit

Permalink
rootmap: fix multipath + LUKS case
Browse files Browse the repository at this point in the history
In the multipath + LUKS case, `get_luks_uuid()` would incorrectly
skip over the multipath partition containing the LUKS header because
`is_dm_device()` returned true. The code eventually errors out when it
gets to the disks backing the multipath device.

The `is_dm_device()` check was added as part of 69b706d ("rootmap:
handle filesystems with LUKS integrity") to correctly handle the LUKS
integrity case in the Secure Execution path. There, the device right
under the LUKS device is another crypt device mapper device used for
integrity that we need to skip over.

Instead of generically checking for a device mapper target, check
specifically that it's a LUKS integrity target before deciding to skip.

Part of: coreos/fedora-coreos-tracker#1728

Co-authored-by: Aashish Radhakrishnan <aaradhak@redhat.com>
Co-authored-by: Gursewak Mangat <gursmangat@gmail.com>
Co-authored-by: Michael Nguyen <mnguyen@redhat.com>
Co-authored-by: Steven Presti <spresti@redhat.com>
  • Loading branch information
5 people committed May 21, 2024
1 parent 2a8884c commit 2fd8265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/rdcore/rootmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn get_luks_uuid(device: &Path) -> Result<String> {
match deps.as_slice() {
[] => bail!("missing parent device for {}", device.display()),
[device] => {
if Disk::new(device)?.is_dm_device() {
if Disk::new(device)?.is_luks_integrity()? {
return get_luks_uuid(device);
}
Ok(runcmd_output!("cryptsetup", "luksUUID", device)?
Expand Down

0 comments on commit 2fd8265

Please sign in to comment.