mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Create dm-integrity with CRYPT_SUBDEV prefix.
When activating dm-integrity device underneath dm-crypt with LUKS2 authenticated encryption mode, annotate the device correctly with CRYPT_SUBDEV prefix. This will help us to clearly identify dependent device underneath LUKS2 top level device and we can unify the deactivation code in future releases. We have general code deactivating dependent devices already for LUKS2 reencrytion. Deactivating newly created devices with pre 2.8.0 cryptsetup will issue warning about missing devices but the deactivation will succeed.
This commit is contained in:
@@ -2923,6 +2923,18 @@ int LUKS2_deactivate(struct crypt_device *cd, const char *name, struct luks2_hdr
|
||||
ret = 0;
|
||||
dep = deps;
|
||||
while (*dep) {
|
||||
/*
|
||||
* FIXME: dm-integrity has now proper SUBDEV prefix so
|
||||
* it would be deactivated here, but due to specific
|
||||
* dm_remove_device(iname) above the iname device
|
||||
* is no longer active. This will be fixed when
|
||||
* we switch to SUBDEV deactivation after 2.8 release.
|
||||
*/
|
||||
if (iname && !strcmp(*dep, iname)) {
|
||||
dep++;
|
||||
continue;
|
||||
}
|
||||
|
||||
log_dbg(cd, "Deactivating LUKS2 dependent device %s.", *dep);
|
||||
r = dm_query_device(cd, *dep, DM_ACTIVE_CRYPT_KEY | DM_ACTIVE_CRYPT_KEYSIZE, &dmdc);
|
||||
if (r < 0) {
|
||||
|
||||
Reference in New Issue
Block a user