]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix tcp_cleanup_rbuf() for tcp_read_skb()
authorCong Wang <cong.wang@bytedance.com>
Wed, 17 Aug 2022 19:54:43 +0000 (12:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 18:04:55 +0000 (11:04 -0700)
commit40019bdb1ae0940d675883dfd86aed0cb8de2562
tree4cd5da4db9550745fa0e2e19bab91495919753a6
parentd08708cd2babb1f0c89c144ec4db19f303dc1eeb
tcp: fix tcp_cleanup_rbuf() for tcp_read_skb()

tcp_cleanup_rbuf() retrieves the skb from sk_receive_queue, it
assumes the skb is not yet dequeued. This is no longer true for
tcp_read_skb() case where we dequeue the skb first.

Fix this by introducing a helper __tcp_cleanup_rbuf() which does
not require any skb and calling it in tcp_read_skb().

Fixes: 4977de2e4917 ("tcp: Introduce tcp_read_skb()")
Cc: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp.c