kernel-fxtec-pro1x/net/tls
John Fastabend a1407b26a6 net: tls, fix sk_write_space NULL write when tx disabled
[ Upstream commit d85f01775850a35eae47a0090839baf510c1ef12 ]

The ctx->sk_write_space pointer is only set when TLS tx mode is enabled.
When running without TX mode its a null pointer but we still set the
sk sk_write_space pointer on close().

Fix the close path to only overwrite sk->sk_write_space when the current
pointer is to the tls_write_space function indicating the tls module should
clean it up properly as well.

Reported-by: Hillf Danton <hdanton@sina.com>
Cc: Ying Xue <ying.xue@windriver.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Fixes: 57c722e932cfb ("net/tls: swap sk_write_space on close")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-06 10:22:04 +02:00
..
Kconfig
Makefile
tls_device.c net/tls: make sure offload also gets the keys wiped 2019-07-28 08:29:27 +02:00
tls_device_fallback.c net/tls: avoid NULL pointer deref on nskb->sk in fallback 2019-05-05 14:42:38 +02:00
tls_main.c net: tls, fix sk_write_space NULL write when tx disabled 2019-09-06 10:22:04 +02:00
tls_sw.c net/tls: Fixed return value when tls_complete_pending_work() fails 2019-09-06 10:22:03 +02:00