diff options
author | Eric Dumazet <edumazet@google.com> | 2020-03-18 19:21:02 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-23 13:02:01 -0700 |
commit | 6cd6cbf593bfa3ae6fc3ed34ac21da4d35045425 (patch) | |
tree | a92fb9e1ad95e07b71c94a62cc42a322dc7fb167 /mm | |
parent | 83a9b6f639e9f6b632337f9776de17d51d969c77 (diff) |
tcp: repair: fix TCP_QUEUE_SEQ implementation
When application uses TCP_QUEUE_SEQ socket option to
change tp->rcv_next, we must also update tp->copied_seq.
Otherwise, stuff relying on tcp_inq() being precise can
eventually be confused.
For example, tcp_zerocopy_receive() might crash because
it does not expect tcp_recv_skb() to return NULL.
We could add tests in various places to fix the issue,
or simply make sure tcp_inq() wont return a random value,
and leave fast path as it is.
Note that this fixes ioctl(fd, SIOCINQ, &val) at the same
time.
Fixes: ee9952831cfd ("tcp: Initial repair mode")
Fixes: 05255b823a61 ("tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions