diff options
author | Cong Wang <cong.wang@bytedance.com> | 2021-03-31 04:32:22 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-04-01 19:56:13 +0200 |
commit | 37f0e514db660f03f8982b8f4fbbd4b2740abe7d (patch) | |
tree | 9f61d1b5c885e8cf94ecd575fbc487c5570c2f68 /net/core | |
parent | tools/resolve_btfids: Fix warnings (diff) | |
download | linux-37f0e514db660f03f8982b8f4fbbd4b2740abe7d.tar.xz linux-37f0e514db660f03f8982b8f4fbbd4b2740abe7d.zip |
skmsg: Lock ingress_skb when purging
Currently we purge the ingress_skb queue only when psock
refcnt goes down to 0, so locking the queue is not necessary,
but in order to be called during ->close, we have to lock it
here.
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210331023237.41094-2-xiyou.wangcong@gmail.com
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skmsg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skmsg.c b/net/core/skmsg.c index 07f54015238a..bebf84ed4e30 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -634,7 +634,7 @@ static void sk_psock_zap_ingress(struct sk_psock *psock) { struct sk_buff *skb; - while ((skb = __skb_dequeue(&psock->ingress_skb)) != NULL) { + while ((skb = skb_dequeue(&psock->ingress_skb)) != NULL) { skb_bpf_redirect_clear(skb); kfree_skb(skb); } |