[dm-devel] dm-crypt: fix return value on invalid AEAD cipher
Mikulas Patocka
mpatocka at redhat.com
Wed May 24 09:35:29 UTC 2023
If the user specifies invalid AEAD cipher, dm-crypt should return the
error returned from crypt_ctr_auth_spec, not -ENOMEM.
Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
---
drivers/md/dm-crypt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-crypt.c 2023-05-17 20:58:17.000000000 +0200
+++ linux-2.6/drivers/md/dm-crypt.c 2023-05-24 11:31:13.000000000 +0200
@@ -2888,7 +2888,7 @@ static int crypt_ctr_cipher_new(struct d
ret = crypt_ctr_auth_cipher(cc, cipher_api);
if (ret < 0) {
ti->error = "Invalid AEAD cipher spec";
- return -ENOMEM;
+ return ret;
}
}
More information about the dm-devel
mailing list