linux/net/tls
Maxim Mikityanskiy f6336724a4 net/tls: Remove the context from the list in tls_device_down
tls_device_down takes a reference on all contexts it's going to move to
the degraded state (software fallback). If sk_destruct runs afterwards,
it can reduce the reference counter back to 1 and return early without
destroying the context. Then tls_device_down will release the reference
it took and call tls_device_free_ctx. However, the context will still
stay in tls_device_down_list forever. The list will contain an item,
memory for which is released, making a memory corruption possible.

Fix the above bug by properly removing the context from all lists before
any call to tls_device_free_ctx.

Fixes: 3740651bf7 ("tls: Fix context leak on tls_device_down")
Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-07-24 21:40:56 +01:00
..
Kconfig
Makefile
tls_device_fallback.c
tls_device.c net/tls: Remove the context from the list in tls_device_down 2022-07-24 21:40:56 +01:00
tls_main.c net/tls: Check for errors in tls_device_init 2022-07-14 10:12:39 -07:00
tls_proc.c
tls_sw.c Revert "tls: rx: move counting TlsDecryptErrors for sync" 2022-07-06 13:10:59 +01:00
tls_toe.c
trace.c
trace.h