Skip to content

Commit faada20

Browse files
maliBrad Figg
authored andcommitted
ext4 crypto: exit cleanly if ext4_derive_key_aes() fails
BugLink: http://bugs.launchpad.net/bugs/1540532 commit d76d99b 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: Laurent Navet <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]>
1 parent ba494aa commit faada20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/ext4/crypto_key.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ int _ext4_get_encryption_info(struct inode *inode)
230230
}
231231
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
232232
raw_key);
233+
if (res)
234+
goto out;
233235
got_key:
234236
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
235237
if (!ctfm || IS_ERR(ctfm)) {

0 commit comments

Comments
 (0)