bpf, sockmap: fix duplicated data transmission
authorJiayuan Chen <jiayuan.chen@linux.dev>
Mon, 7 Apr 2025 14:21:21 +0000 (22:21 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 10 Apr 2025 02:58:59 +0000 (19:58 -0700)
commit3b4f14b794287be137ea2c6158765d1ea1e018a4
treea7dc80d5fbce25794a3604313dbf7cd7af991932
parent7683167196bd727ad5f3c3fc6a9ca70f54520a81
bpf, sockmap: fix duplicated data transmission

In the !ingress path under sk_psock_handle_skb(), when sending data to the
remote under snd_buf limitations, partial skb data might be transmitted.

Although we preserved the partial transmission state (offset/length), the
state wasn't properly consumed during retries. This caused the retry path
to resend the entire skb data instead of continuing from the previous
offset, resulting in data overlap at the receiver side.

Fixes: 405df89dd52c ("bpf, sockmap: Improved check for empty queue")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20250407142234.47591-3-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/core/skmsg.c