mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/2] tcp: annotate lockless access to sk->sk_err
@ 2026-09-25 12:47 Quanye Yang via B4 Relay
  2026-09-25 12:47 ` [PATCH net-next v5 1/2] " Quanye Yang via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Quanye Yang via B4 Relay @ 2026-09-25 12:47 UTC (permalink / raw)
  To: Eric Dumazet, Neal Cardwell, Kuniyuki Iwashima, David S. Miller,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Matthieu Baerts (NGI0),
	Geliang Tang, Mat Martineau, Jiayuan Chen
  Cc: netdev, linux-kernel

do_recvmmsg() and getsockopt(SO_ERROR) call sock_error() without the
socket lock and clear sk_err with xchg().

Patch 1 covers TCP. Peek-only sites use READ_ONCE(). On the no-data
recv and splice paths, call sock_error() once and only stop when it
returns a non-zero error. tcp_bpf_sendmsg() folds two unmarked loads
into one READ_ONCE() and uses that value as the returned errno.

Patch 2 does the same for MPTCP and annotates the remaining subflow
error-report peeks.

---
Changes in v5:
- recv/splice: call sock_error() once instead of peek-then-consume
- mention the tcp_bpf_sendmsg() READ_ONCE fold in the TCP commit
- Link to v4: https://patch.msgid.link/20260917-mptcp-sk-err-net-v4-0-1f04f52f2561@proton.me

Changes in v4:
- split the annotation change, one points to tcp and another points to
  mptcp.
- annotate the remaining unmarked MPTCP sk_err peeks on the
  subflow error-report path.
- Link to v3: https://patch.msgid.link/20260912-mptcp-sk-err-net-v3-1-c41383878bde@proton.me

Changes in v3:
- drop the Fixes tag and retarget to net-next
- annotate the remaining unmarked sk_err peeks on the TCP/MPTCP
  send, recv and splice paths
- Link to v2: https://patch.msgid.link/20260909-mptcp-sk-err-net-v2-1-5044abecac90@proton.me

Changes in v2:
- add Reported-by and Closes for the MPTCP syzkaller report
- Link to v1: https://patch.msgid.link/20260908-mptcp-sk-err-net-v1-1-da71aaec9afd@proton.me

---
Quanye Yang (2):
      tcp: annotate lockless access to sk->sk_err
      mptcp: annotate lockless access to sk->sk_err

 include/net/tcp.h    |  2 +-
 net/core/stream.c    |  2 +-
 net/ipv4/tcp.c       | 12 +++++-------
 net/ipv4/tcp_bpf.c   | 10 ++++------
 net/mptcp/protocol.c | 14 ++++++--------
 net/mptcp/subflow.c  |  4 ++--
 6 files changed, 19 insertions(+), 25 deletions(-)
---
base-commit: 211f2a875f6f447745d80d5762d6d614503ac84a
change-id: 20260908-mptcp-sk-err-net-7ff88ef05044

Best regards,
--  
Quanye Yang <quanyeyang@proton.me>



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-01 12:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 12:47 [PATCH net-next v5 0/2] tcp: annotate lockless access to sk->sk_err Quanye Yang via B4 Relay
2026-09-25 12:47 ` [PATCH net-next v5 1/2] " Quanye Yang via B4 Relay
2026-10-01  0:21   ` Jakub Kicinski
2026-10-01  7:24     ` Eric Dumazet
2026-09-25 12:47 ` [PATCH net-next v5 2/2] mptcp: " Quanye Yang via B4 Relay
2026-10-01  7:32   ` Matthieu Baerts
2026-10-01  9:10 ` [PATCH net-next v5 0/2] tcp: " patchwork-bot+netdevbpf
2026-10-01  9:10 ` Paolo Abeni
2026-10-01 12:44   ` quanyeyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®