opal: do not initialize LRs array in activation.

The lr member in opal_lr_act kernel structure is
ingnored unless the device is being activated in SUM
mode.

See kernel implementation of IOC_OPAL_ACTIVATE_LSP
in block/sed-opal.c
This commit is contained in:
Ondrej Kozina
2025-07-31 13:29:18 +02:00
parent 441802773f
commit 83a7310ca2

View File

@@ -415,11 +415,8 @@ static int opal_activate_lsp(struct crypt_device *cd, int fd,
.key = { .key = {
.key_len = admin_key_len, .key_len = admin_key_len,
}, },
.num_lrs = 8, /* useless but due to kernel bug it requires (num_lrs > 0 && num_lrs <= 9) */
/* A max of 9 segments are supported, enable them all as there's no reason not to .num_lrs = 1,
* (0 is whole-volume)
*/
.lr = { 1, 2, 3, 4, 5, 6, 7, 8 },
}; };
crypt_safe_memcpy(activate->key.key, admin_key, admin_key_len); crypt_safe_memcpy(activate->key.key, admin_key, admin_key_len);