mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix crypt_init_by_name() for dm-crypt with integrity.
Initialization by name for dm-crypt with integrity is always underlying device for dm-integrity target, not dm-integrity device itself. This fixes various problems like refresh command or device printed in status command. Fixes: #801
This commit is contained in:
11
lib/setup.c
11
lib/setup.c
@@ -1260,10 +1260,13 @@ static int _init_by_name_crypt(struct crypt_device *cd, const char *name)
|
||||
r = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (!cd->metadata_device) {
|
||||
device_free(cd, cd->device);
|
||||
MOVE_REF(cd->device, tgti->data_device);
|
||||
}
|
||||
|
||||
/*
|
||||
* Data device for crypt with integrity is not dm-integrity device,
|
||||
* but always the device underlying dm-integrity.
|
||||
*/
|
||||
device_free(cd, cd->device);
|
||||
MOVE_REF(cd->device, tgti->data_device);
|
||||
}
|
||||
|
||||
/* do not try to lookup LUKS2 header in detached header mode */
|
||||
|
||||
Reference in New Issue
Block a user