]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: Fix memory leak in tls_enc_skb() and tls_sw_fallback_init()
authorYu Liao <liaoyu15@huawei.com>
Thu, 10 Nov 2022 09:03:29 +0000 (17:03 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 12 Nov 2022 04:08:17 +0000 (20:08 -0800)
commitcbf6ec0440645f83edba32f028327ca43e8558bd
tree42766de05e1011f2e5edfa6aeec941bc69e3c628
parentda0511fe3d3debadcd88596f13142ad009a997e7
net/tls: Fix memory leak in tls_enc_skb() and tls_sw_fallback_init()

'aead_req' and 'aead_send' is allocated but not freed in default switch
case. This commit fixes the potential memory leak by freeing them under
the situation.

Note that the default cases here should never be reached as they'd
mean we allowed offloading an unsupported algorithm.

Fixes: debb427d705c ("net/tls: Use cipher sizes structs")
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Link: https://lore.kernel.org/r/20221110090329.2036382-1-liaoyu15@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device_fallback.c