tcp: handle pure FIN case correctly
authorCong Wang <cong.wang@bytedance.com>
Wed, 17 Aug 2022 19:54:45 +0000 (12:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 18:04:56 +0000 (11:04 -0700)
commit2e23acd99efacfd2a63cb9725afbc65e4e964fb7
tree7378084ad03e9513090482684a21c6e810d61b36
parenta8688821f3854f37fe0198b8945f9cfc051ab2cf
tcp: handle pure FIN case correctly

When skb->len==0, the recv_actor() returns 0 too, but we also use 0
for error conditions. This patch amends this by propagating the errors
to tcp_read_skb() so that we can distinguish skb->len==0 case from
error cases.

Fixes: 04919bed948d ("tcp: Introduce tcp_read_skb()")
Reported-by: 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/core/skmsg.c
net/ipv4/tcp.c