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 1653383 - cryptsetup is unable to handle LUKS2 devices with non-default metadata size
Summary: cryptsetup is unable to handle LUKS2 devices with non-default metadata size
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: cryptsetup
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Ondrej Kozina
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1653388
TreeView+ depends on / blocked
 
Reported: 2018-11-26 17:02 UTC by Ondrej Kozina
Modified: 2021-09-06 15:22 UTC (History)
7 users (show)

Fixed In Version: cryptsetup-2.0.6-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1653388 (view as bug list)
Environment:
Last Closed: 2019-06-14 01:46:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
Archive containing all LUKS2 metadata variants (152.37 KB, application/octet-stream)
2018-11-29 09:23 UTC, Ondrej Kozina
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-20344 0 None None None 2021-09-06 15:22:54 UTC

Description Ondrej Kozina 2018-11-26 17:02:23 UTC
LUKS2 specification [1] defines limited set of valid LUKS2 metadata sizes (see chapter 2.1 and 2.2 of the specification). Currently cryptsetup creates only 16 KiB variant of LUKS2 metadata (4KiB binary header + 12KiB json area). This applies also to LUKS2 containers created via up-conversion from LUKS1 format.

Unfortunately current cryptsetup (any upstream version < cryptsetup-2.0.6) rejects any non-default LUKS2 metadata size (32KiB and larger) as invalid LUKS2 format. This is bug in internal validation code but format (metadata itself) is not affected in any way.

Even though current cryptsetup in RHEL8 does not support creating LUKS2 containers with non-default metadata size, it must be able to parse, validate, load and modify any LUKS2 metadata size specified in LUKS2 format documentation [1].

[1] https://gitlab.com/cryptsetup/cryptsetup/blob/master/docs/on-disk-format-luks2.pdf

Comment 3 Ondrej Kozina 2018-11-29 09:23:41 UTC
Created attachment 1509759 [details]
Archive containing all LUKS2 metadata variants

All images have single active keyslot 0 that can be unlocked with passphrase: Qx3qn46vq0v

Comment 4 Ondrej Kozina 2018-11-29 09:27:17 UTC
To verify this bug, fixed cryptsetup must unlock all metadata variants (and also be able to perform any metadata modifying operation). Current cryptsetup-2.0.4-2.el8 can unlock/handle only test_image_16 (16KiB LUKS2 metadata).

Comment 7 Peter Kotvan 2019-02-05 11:43:10 UTC
Hi Ondrej,

there is no reproducer to verify this bug. Are you able to verify it yourself or provide a reproducer?

Comment 8 Ondrej Kozina 2019-02-05 12:21:39 UTC
I don't have better reproducer than one desribed in comment #3 (test images) and comment #4. To test unlock capability just run cryptsetup open command, to test write capability you may try to add new keyslot (cryptsetup luksAddKey). To test it on real drive just dd the test image in head of your test block device.

Comment 9 Peter Kotvan 2019-02-06 08:56:10 UTC
Thanks Ondrej,

I was able to reproduce this issue on RHEL-8.0-20181120.0 and verify the fix on RHEL-8.0.0-20190129.1. Moving to verified.


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