]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, sockmap: fix duplicated data transmission
authorJiayuan Chen <jiayuan.chen@linux.dev>
Mon, 7 Apr 2025 14:21:21 +0000 (22:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:11 +0000 (11:05 +0100)
commitd6181bd1dfa1a327096e2edc5f4d9bd582bbf012
tree67f0f7a39ed145f77d014d7b675698038e60c9f5
parent2160dcc38acfbf4b36500388fd3bb5251eb994d0
bpf, sockmap: fix duplicated data transmission

[ Upstream commit 3b4f14b794287be137ea2c6158765d1ea1e018a4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/skmsg.c