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
This commit is contained in:
Kristina Hanicova
2025-12-10 17:58:36 +01:00
parent 58d9054920
commit cdb6a56260

View File

@@ -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)) {