summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2018-12-20 20:35:34 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-12-20 23:47:09 +0100
commita136678c0bdbb650daff5df5eec1dab960e074a7 (patch)
treed5bb32c153cfcadfbbecd612aea1bee8a6a5cd3f /net/core
parentbpf: sk_msg, fix socket data_ready events (diff)
downloadlinux-a136678c0bdbb650daff5df5eec1dab960e074a7.tar.xz
linux-a136678c0bdbb650daff5df5eec1dab960e074a7.zip
bpf: sk_msg, zap ingress queue on psock down
In addition to releasing any cork'ed data on a psock when the psock is removed we should also release any skb's in the ingress work queue. Otherwise the skb's eventually get free'd but late in the tear down process so we see the WARNING due to non-zero sk_forward_alloc. void sk_stream_kill_queues(struct sock *sk) { ... WARN_ON(sk->sk_forward_alloc); ... } Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skmsg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index 3df7627db4bb..86c9726fced8 100644
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
@@ -572,6 +572,7 @@ void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
{
rcu_assign_sk_user_data(sk, NULL);
sk_psock_cork_free(psock);
+ sk_psock_zap_ingress(psock);
sk_psock_restore_proto(sk, psock);
write_lock_bh(&sk->sk_callback_lock);