mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Check dm-zero availability for bitlk type.
Bitlocker compatible mode uses dm-zero to mask metadata area, device cannot be activated if dm-zero is not available. Just add zero target check to device-mapper backend and if activation fails, print a better error message here. Fixes: #722
This commit is contained in:
@@ -1207,7 +1207,7 @@ static int _activate(struct crypt_device *cd,
|
||||
uint64_t next_start = 0;
|
||||
uint64_t next_end = 0;
|
||||
uint64_t last_segment = 0;
|
||||
uint32_t dmt_flags;
|
||||
uint32_t dmt_flags = 0;
|
||||
|
||||
r = _activate_check(cd, params);
|
||||
if (r)
|
||||
@@ -1348,6 +1348,10 @@ static int _activate(struct crypt_device *cd,
|
||||
log_err(cd, _("Cannot activate device, kernel dm-crypt is missing support for BITLK Elephant diffuser."));
|
||||
r = -ENOTSUP;
|
||||
}
|
||||
if (dm_flags(cd, DM_ZERO, &dmt_flags) < 0) {
|
||||
log_err(cd, _("Cannot activate device, kernel dm-zero module is missing."));
|
||||
r = -ENOTSUP;
|
||||
}
|
||||
}
|
||||
out:
|
||||
dm_targets_free(cd, &dmd);
|
||||
|
||||
Reference in New Issue
Block a user