diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2024-05-17 08:54:35 +0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-05-21 13:16:25 +0200 |
commit | efb9f4f19f8e37fde43dfecebc80292d179f56c6 (patch) | |
tree | 786dd6ecfd7ff77864aa2b8b6b7e8f17d320f660 /net/unix/garbage.c | |
parent | 9841991a446c87f90f66f4b9fee6fe934c1336a2 (diff) | |
download | linux-stable-efb9f4f19f8e37fde43dfecebc80292d179f56c6.tar.gz linux-stable-efb9f4f19f8e37fde43dfecebc80292d179f56c6.tar.bz2 linux-stable-efb9f4f19f8e37fde43dfecebc80292d179f56c6.zip |
ipv6: sr: fix memleak in seg6_hmac_init_algo
seg6_hmac_init_algo returns without cleaning up the previous allocations
if one fails, so it's going to leak all that memory and the crypto tfms.
Update seg6_hmac_exit to only free the memory when allocated, so we can
reuse the code directly.
Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Closes: https://lore.kernel.org/netdev/Zj3bh-gE7eT6V6aH@hog/
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/20240517005435.2600277-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/unix/garbage.c')
0 files changed, 0 insertions, 0 deletions