Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootmap: fix multipath + LUKS case #1473

Merged
merged 2 commits into from
Jun 17, 2024
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented May 21, 2024

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

jlebon and others added 2 commits May 21, 2024 15:12
To iterate faster, it's convenient to be able to run `rdcore rootmap`
directly from the real root (mounted over from the development host)
and pointing it at `/`. But the naive appending we do here to find the
physical root would give `//sysroot` which isn't in the mount table
(obviously we could also canonicalize, but it's just cleaner to join it
correctly in the first place).
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 <[email protected]>
Co-authored-by: Gursewak Mangat <[email protected]>
Co-authored-by: Michael Nguyen <[email protected]>
Co-authored-by: Steven Presti <[email protected]>
@jlebon jlebon force-pushed the pr/multipath-luks-fixes branch from 8c0d765 to 0d42e10 Compare May 21, 2024 19:13
@jlebon jlebon mentioned this pull request May 23, 2024
@jlebon
Copy link
Member Author

jlebon commented May 27, 2024

CI is currently broken (see also #1474).

@jlebon
Copy link
Member Author

jlebon commented Jun 6, 2024

This is ready for review now!

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@yasminvalim yasminvalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@jlebon jlebon merged commit 6500df7 into coreos:main Jun 17, 2024
14 checks passed
@jlebon jlebon deleted the pr/multipath-luks-fixes branch June 17, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants