]> git.baikalelectronics.ru Git - kernel.git/commit
tls: fix sw_ctx leak
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 16 Jan 2018 15:04:26 +0000 (16:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Jan 2018 21:16:03 +0000 (16:16 -0500)
commit4f8a2e9c95cf9603d3e39be5d68278fade058456
tree0e2e7f8c15b36422f69874435375d3445688893f
parentc9de02a8f3812bfa783042c98e575b00a1e5fd8e
tls: fix sw_ctx leak

During setsockopt(SOL_TCP, TLS_TX), if initialization of the software
context fails in tls_set_sw_offload(), we leak sw_ctx. We also don't
reassign ctx->priv_ctx to NULL, so we can't even do another attempt to
set it up on the same socket, as it will fail with -EEXIST.

Fixes: 3a71956a2d9a ('tls: kernel TLS support')
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c