Re: [PATCH net-next v5 0/2] tcp: annotate lockless access to sk->sk_err

From: Paolo Abeni

Date: Thu Oct 01 2026 - 05:13:05 EST


On 9/25/26 14:47, Quanye Yang via B4 Relay wrote:
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.
Note that there are more possible follow-ups in tls and on the write side:

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260925-mptcp-sk-err-net-v5-0-0cac04d6ea48@xxxxxxxxx

/P