]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mptcp: fix MSG_PEEK stream corruption
authorPaolo Abeni <pabeni@redhat.com>
Tue, 28 Oct 2025 08:16:53 +0000 (09:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Oct 2025 00:44:28 +0000 (17:44 -0700)
commit8e04ce45a8db7a080220e86e249198fa676b83dc
tree8a38c7577dea018fd265a29f8f9f68090ce4a4f0
parent27b0e701d3872ba59c5b579a9e8a02ea49ad3d3b
mptcp: fix MSG_PEEK stream corruption

If a MSG_PEEK | MSG_WAITALL read operation consumes all the bytes in the
receive queue and recvmsg() need to waits for more data - i.e. it's a
blocking one - upon arrival of the next packet the MPTCP protocol will
start again copying the oldest data present in the receive queue,
corrupting the data stream.

Address the issue explicitly tracking the peeked sequence number,
restarting from the last peeked byte.

Fixes: ca4fb892579f ("mptcp: add MSG_PEEK support")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Geliang Tang <geliang@kernel.org>
Tested-by: Geliang Tang <geliang@kernel.org>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251028-net-mptcp-send-timeout-v1-2-38ffff5a9ec8@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c