Skip to content

Commit 83a7310

Browse files
committed
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
1 parent 4418027 commit 83a7310

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/luks2/hw_opal/hw_opal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,8 @@ static int opal_activate_lsp(struct crypt_device *cd, int fd,
415415
.key = {
416416
.key_len = admin_key_len,
417417
},
418-
.num_lrs = 8,
419-
/* A max of 9 segments are supported, enable them all as there's no reason not to
420-
* (0 is whole-volume)
421-
*/
422-
.lr = { 1, 2, 3, 4, 5, 6, 7, 8 },
418+
/* useless but due to kernel bug it requires (num_lrs > 0 && num_lrs <= 9) */
419+
.num_lrs = 1,
423420
};
424421
crypt_safe_memcpy(activate->key.key, admin_key, admin_key_len);
425422

0 commit comments

Comments
 (0)