mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Harden LUKS2 decryption with datashift parameters.
Abort early if detached header is passed in API by any chance.
This commit is contained in:
@@ -2734,8 +2734,12 @@ static int reencrypt_decrypt_with_datashift_init(struct crypt_device *cd,
|
|||||||
assert(hdr);
|
assert(hdr);
|
||||||
assert(params);
|
assert(params);
|
||||||
assert(params->resilience);
|
assert(params->resilience);
|
||||||
|
assert(params->data_shift);
|
||||||
assert(vks);
|
assert(vks);
|
||||||
|
|
||||||
|
if (!data_offset)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (params->max_hotzone_size > params->data_shift) {
|
if (params->max_hotzone_size > params->data_shift) {
|
||||||
log_err(cd, _("Moved segment size can not be greater than data shift value."));
|
log_err(cd, _("Moved segment size can not be greater than data shift value."));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user