From 55e0209a4e751e4edb3662827a57cd5d330f30c2 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 11 Dec 2025 23:40:14 +0100 Subject: [PATCH] Fix LUKS2 device status in inline HW mode and detached header Internal type is not set if detached header is not specified, but inline tag check should be done anyway. --- lib/setup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/setup.c b/lib/setup.c index 3a411733..1ee02db5 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -5838,8 +5838,12 @@ int crypt_get_active_device(struct crypt_device *cd, const char *name, if (r < 0) return r; - /* For LUKS2 with integrity we need flags from underlying dm-integrity */ - if (isLUKS2(cd->type) && crypt_get_integrity_tag_size(cd) && + /* + * For integrity and LUKS2 (and detached header where context is NULL) + * we need flags from underlying dm-integrity device. + * This check must be skipped for non-LUKS2 integrity device. + */ + if ((isLUKS2(cd->type) || !cd->type) && crypt_get_integrity_tag_size(cd) && (iname = dm_get_active_iname(cd, name))) { if (dm_query_device(cd, iname, 0, &dmdi) >= 0) dmd.flags |= dmdi.flags;