Security Advisory

References
https://github.com/torvalds/linux/commit/128c66429247add5128c03dc1e144ca56f05a4e2

ccp - Release all allocated memory if sha type is invalid

Release all allocated memory if sha type is invalid:
In ccp_run_sha_cmd, if the type of sha is invalid, the allocated hmac_buf 
should be released.

v2: fix the goto.

Signed-off-by: Navid Emamdoost <[email protected]>
Acked-by: Gary R Hook <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
---
 drivers/crypto/ccp/ccp-ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index 330853a27..43b74cf07 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -1783,8 +1783,9 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct 
ccp_cmd *cmd)
                               LSB_ITEM_SIZE);
                        break;
                default:
+                       kfree(hmac_buf);
                        ret = -EINVAL;
-                       goto e_ctx;
+                       goto e_data;
                }
 
                memset(&hmac_cmd, 0, sizeof(hmac_cmd));
-- 
2.20.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8489): 
https://lists.yoctoproject.org/g/linux-yocto/message/8489
Mute This Topic: https://lists.yoctoproject.org/mt/71993297/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to