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: [email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Reviewed-by: Geliang Tang <[email protected]>
Tested-by: Geliang Tang <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>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