]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: sk_msg, zap ingress queue on psock down
authorJohn Fastabend <john.fastabend@gmail.com>
Thu, 20 Dec 2018 19:35:34 +0000 (11:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:26 +0000 (20:02 +0100)
commit91a87d4fb0e625348714d3ae1c5370f3b5b8d136
tree586767bf7ac965fc1e1a1a778a0fc15f385240da
parent3b0b78c4fe49b25926eca4703e0ad19db92e47f3
bpf: sk_msg, zap ingress queue on psock down

[ Upstream commit a136678c0bdbb650daff5df5eec1dab960e074a7 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/skmsg.c