Commit 8e04ce4
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: 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>1 parent 27b0e70 commit 8e04ce4
1 file changed
Lines changed: 25 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
1948 | | - | |
1949 | | - | |
1950 | | - | |
| 1948 | + | |
| 1949 | + | |
1951 | 1950 | | |
1952 | 1951 | | |
1953 | 1952 | | |
1954 | 1953 | | |
1955 | 1954 | | |
| 1955 | + | |
1956 | 1956 | | |
1957 | 1957 | | |
1958 | 1958 | | |
1959 | | - | |
| 1959 | + | |
1960 | 1960 | | |
1961 | | - | |
| 1961 | + | |
1962 | 1962 | | |
1963 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
1964 | 1978 | | |
1965 | 1979 | | |
1966 | 1980 | | |
| |||
1977 | 1991 | | |
1978 | 1992 | | |
1979 | 1993 | | |
1980 | | - | |
1981 | | - | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
1982 | 1997 | | |
1983 | 1998 | | |
1984 | | - | |
| 1999 | + | |
1985 | 2000 | | |
1986 | | - | |
1987 | | - | |
1988 | 2001 | | |
1989 | | - | |
1990 | 2002 | | |
1991 | 2003 | | |
1992 | 2004 | | |
1993 | 2005 | | |
1994 | 2006 | | |
1995 | 2007 | | |
1996 | 2008 | | |
1997 | | - | |
1998 | 2009 | | |
1999 | 2010 | | |
2000 | 2011 | | |
| |||
2191 | 2202 | | |
2192 | 2203 | | |
2193 | 2204 | | |
2194 | | - | |
| 2205 | + | |
| 2206 | + | |
2195 | 2207 | | |
2196 | 2208 | | |
2197 | 2209 | | |
| |||
0 commit comments