Commit d5d7ed70 authored by Laurent Navet's avatar Laurent Navet Committed by Kamal Mostafa

ext4 crypto: exit cleanly if ext4_derive_key_aes() fails

commit d76d99b2 upstream.

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: default avatarLaurent Navet <laurent.navet@gmail.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent bbd4fa56
......@@ -230,6 +230,8 @@ int _ext4_get_encryption_info(struct inode *inode)
}
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
raw_key);
if (res)
goto out;
got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
if (!ctfm || IS_ERR(ctfm)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment