diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-08-10 04:36:23 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-06 11:22:04 +0300 |
commit | fdc4400e962804bc9d9364fcaa998c0b084eff72 (patch) | |
tree | c6380e28f54e1f32be6f630d4a847b59748cba2e | |
parent | f7009bbaff54d5e4b72909ac3beb07920dd95d84 (diff) | |
download | linux-fdc4400e962804bc9d9364fcaa998c0b084eff72.tar.xz |
net/tls: swap sk_write_space on close
[ Upstream commit 57c722e932cfb82e9820bbaae1b1f7222ea97b52 ]
Now that we swap the original proto and clear the ULP pointer
on close we have to make sure no callback will try to access
the freed state. sk_write_space is not part of sk_prot, remember
to swap it.
Reported-by: syzbot+dcdc9deefaec44785f32@syzkaller.appspotmail.com
Fixes: 95fa145479fb ("bpf: sockmap/tls, close can race with map free")
Signed-off-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>
-rw-r--r-- | net/tls/tls_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 4c0ac79f82d4..f636aff11d51 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -301,6 +301,7 @@ static void tls_sk_proto_close(struct sock *sk, long timeout) #else { #endif + sk->sk_write_space = ctx->sk_write_space; tls_ctx_free(ctx); ctx = NULL; } |