Commit b3c0f66
mptcp: fix MSG_PEEK stream corruption
[ Upstream commit 8e04ce45a8db7a080220e86e249198fa676b83dc ]
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: ca4fb89 ("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>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0206a9341e652167c610dcd79f3d4e9e8153984c)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>1 parent 2af5611 commit b3c0f66
1 file changed
+25
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1977 | 1977 | | |
1978 | 1978 | | |
1979 | 1979 | | |
1980 | | - | |
| 1980 | + | |
1981 | 1981 | | |
1982 | 1982 | | |
1983 | 1983 | | |
1984 | 1984 | | |
| 1985 | + | |
1985 | 1986 | | |
1986 | 1987 | | |
1987 | 1988 | | |
1988 | | - | |
| 1989 | + | |
1989 | 1990 | | |
1990 | | - | |
| 1991 | + | |
1991 | 1992 | | |
1992 | 1993 | | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
1993 | 2009 | | |
1994 | 2010 | | |
1995 | 2011 | | |
| |||
2006 | 2022 | | |
2007 | 2023 | | |
2008 | 2024 | | |
2009 | | - | |
2010 | | - | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
2011 | 2028 | | |
2012 | 2029 | | |
2013 | | - | |
| 2030 | + | |
2014 | 2031 | | |
2015 | | - | |
2016 | | - | |
2017 | 2032 | | |
2018 | | - | |
2019 | 2033 | | |
2020 | 2034 | | |
2021 | 2035 | | |
2022 | 2036 | | |
2023 | 2037 | | |
2024 | | - | |
2025 | 2038 | | |
2026 | 2039 | | |
2027 | 2040 | | |
| |||
2245 | 2258 | | |
2246 | 2259 | | |
2247 | 2260 | | |
2248 | | - | |
| 2261 | + | |
| 2262 | + | |
2249 | 2263 | | |
2250 | 2264 | | |
2251 | 2265 | | |
| |||
0 commit comments