cryptsetup/cryptsetup-2.8.2-Set-inline-integrity-flag-if-no-underlying-dm-integr.patch
Kristina Hanicova aea524f79f Additional cryptsetup fixes for 2.8.1
Resolves: RHEL-122297 RHEL-125152 RHEL-125167 RHEL-132585 RHEL-140106
2026-01-09 21:18:37 +01:00

39 lines
1.4 KiB
Diff

From cdb6a5626089a56a7a135042be7c157acda70506 Mon Sep 17 00:00:00 2001
Message-ID: <cdb6a5626089a56a7a135042be7c157acda70506.1766065116.git.khanicov@redhat.com>
From: Kristina Hanicova <khanicov@redhat.com>
Date: Wed, 10 Dec 2025 17:58:36 +0100
Subject: [PATCH] Set inline integrity flag if no underlying dm-integrity
device
Cryptsetup status does not report when the hw inline integrity is
set without the underlying dm-integrity device.
Fixes: #965
---
lib/setup.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/setup.c b/lib/setup.c
index 1ee02db5..93c7ef5f 100644
--- a/lib/setup.c
+++ b/lib/setup.c
@@ -5843,11 +5843,13 @@ int crypt_get_active_device(struct crypt_device *cd, const char *name,
* 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;
- free(iname);
+ if ((isLUKS2(cd->type) || !cd->type) && crypt_get_integrity_tag_size(cd)) {
+ if ((iname = dm_get_active_iname(cd, name))) {
+ if (dm_query_device(cd, iname, 0, &dmdi) >= 0)
+ dmd.flags |= dmdi.flags;
+ free(iname);
+ } else
+ dmd.flags |= (CRYPT_ACTIVATE_NO_JOURNAL | CRYPT_ACTIVATE_INLINE_MODE);
}
if (cd && isTCRYPT(cd->type)) {