mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Check HW OPAL range parameters in proper units.
The opal_range_check_attributes_fd function expected both offset and length parameters of a LR to be passed in sectors (512B). During format we passed it wrongly in OPAL blocks which caused bogus check provided OPAL block size was not 512B. Fixes: #871.
This commit is contained in:
@@ -2556,7 +2556,8 @@ int crypt_format_luks2_opal(struct crypt_device *cd,
|
||||
|
||||
r = opal_setup_ranges(cd, crypt_data_device(cd), user_key ?: cd->volume_key,
|
||||
range_offset_blocks, range_size_bytes / opal_block_bytes,
|
||||
opal_segment_number, opal_params->admin_key, opal_params->admin_key_size);
|
||||
opal_block_bytes, opal_segment_number,
|
||||
opal_params->admin_key, opal_params->admin_key_size);
|
||||
if (r < 0) {
|
||||
if (r == -EPERM)
|
||||
log_err(cd, _("Incorrect OPAL Admin key."));
|
||||
|
||||
Reference in New Issue
Block a user