ext4 crypto: exit cleanly if ext4_derive_key_aes() fails
Return value of ext4_derive_key_aes() is stored but not used. Add test to exit cleanly if ext4_derive_key_aes() fail. Also fix coverity CID 1309760. Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Родитель
5ba92bcf0d
Коммит
d76d99b219
|
@ -220,6 +220,8 @@ retry:
|
||||||
BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
|
BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
|
||||||
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
|
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
|
||||||
raw_key);
|
raw_key);
|
||||||
|
if (res)
|
||||||
|
goto out;
|
||||||
got_key:
|
got_key:
|
||||||
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
|
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
|
||||||
if (!ctfm || IS_ERR(ctfm)) {
|
if (!ctfm || IS_ERR(ctfm)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче