mbox series

[net,0/4] tcp: fix tcp_poll() races

Message ID 20240524193630.2007563-1-edumazet@google.com (mailing list archive)
Headers show
Series tcp: fix tcp_poll() races | expand

Message

Eric Dumazet May 24, 2024, 7:36 p.m. UTC
Flakes in packetdrill tests stressing epoll_wait()
were root caused to bad ordering in tcp_write_err()

Namely, we have to call sk_error_report() after
tcp_done().

When fixing this issue, we discovered tcp_abort(),
tcp_v4_err() and tcp_v6_err() had similar issues.

Since tcp_reset() has the correct ordering,
first patch takes part of it and creates
tcp_done_with_error() helper.

Eric Dumazet (4):
  tcp: add tcp_done_with_error() helper
  tcp: fix race in tcp_write_err()
  tcp: fix races in tcp_abort()
  tcp: fix races in tcp_v[46]_err()

 include/net/tcp.h    |  1 +
 net/ipv4/tcp.c       |  7 ++-----
 net/ipv4/tcp_input.c | 25 +++++++++++++++++--------
 net/ipv4/tcp_ipv4.c  |  5 +----
 net/ipv4/tcp_timer.c |  5 ++---
 net/ipv6/tcp_ipv6.c  |  4 +---
 6 files changed, 24 insertions(+), 23 deletions(-)