tcp: fix splice() and tcp collapsing interaction
authorEric Dumazet <edumazet@google.com>
Wed, 9 Jan 2013 20:59:09 +0000 (20:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 18:48:36 +0000 (10:48 -0800)
commit0f0ac9b6a73fe6025723fa4a51c8da2ccead6bff
treee51e5f43c82a661603b1c6a5660666c5eddfb76e
parent09ea1383126d942a993b0895cec16e0961db5af9
tcp: fix splice() and tcp collapsing interaction

[ Upstream commit f26845b43c75d3f32f98d194c1327b5b1e6b3fb0 ]

Under unusual circumstances, TCP collapse can split a big GRO TCP packet
while its being used in a splice(socket->pipe) operation.

skb_splice_bits() releases the socket lock before calling
splice_to_pipe().

[ 1081.353685] WARNING: at net/ipv4/tcp.c:1330 tcp_cleanup_rbuf+0x4d/0xfc()
[ 1081.371956] Hardware name: System x3690 X5 -[7148Z68]-
[ 1081.391820] cleanup rbuf bug: copied AD3BCF1 seq AD370AF rcvnxt AD3CF13

To fix this problem, we must eat skbs in tcp_recv_skb().

Remove the inline keyword from tcp_recv_skb() definition since
it has three call sites.

Reported-by: Christian Becker <c.becker@traviangames.com>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp.c