mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 18:11:47 +00:00
crypto: ccp - Fix oops by properly managing allocated structures
A plaintext or ciphertext length of 0 is allowed in AES, in which case
no encryption occurs. Ensure that we don't clean up data structures
that were never allocated.
Fixes: 36cf515b9b
("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
cf144f81a9
commit
25e4433832
@ -859,11 +859,11 @@ e_tag:
|
|||||||
ccp_dm_free(&final_wa);
|
ccp_dm_free(&final_wa);
|
||||||
|
|
||||||
e_dst:
|
e_dst:
|
||||||
if (aes->src_len && !in_place)
|
if (ilen > 0 && !in_place)
|
||||||
ccp_free_data(&dst, cmd_q);
|
ccp_free_data(&dst, cmd_q);
|
||||||
|
|
||||||
e_src:
|
e_src:
|
||||||
if (aes->src_len)
|
if (ilen > 0)
|
||||||
ccp_free_data(&src, cmd_q);
|
ccp_free_data(&src, cmd_q);
|
||||||
|
|
||||||
e_aad:
|
e_aad:
|
||||||
|
Loading…
Reference in New Issue
Block a user