Eric Dumazet 3d13008e73 ip: fix truesize mismatch in ip fragmentation
Special care should be taken when slow path is hit in ip_fragment() :

When walking through frags, we transfert truesize ownership from skb to
frags. Then if we hit a slow_path condition, we must undo this or risk
uncharging frags->truesize twice, and in the end, having negative socket
sk_wmem_alloc counter, or even freeing socket sooner than expected.

Many thanks to Nick Bowler, who provided a very clean bug report and
test program.

Thanks to Jarek for reviewing my first patch and providing a V2

While Nick bisection pointed to commit 2b85a34e911 (net: No more
expensive sock_hold()/sock_put() on each tx), underlying bug is older
(2.6.12-rc5)

A side effect is to extend work done in commit b2722b1c3a893e
(ip_fragment: also adjust skb->truesize for packets not owned by a
socket) to ipv6 as well.

Reported-and-bisected-by: Nick Bowler <nbowler@elliptictech.com>
Tested-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-21 15:05:50 -07:00
..
2010-06-02 05:16:23 -07:00
2010-09-08 21:45:01 -07:00
2010-02-22 16:20:22 -08:00
2010-06-09 18:39:27 -07:00
2010-06-07 02:57:14 -07:00
2010-02-22 16:20:22 -08:00
2010-06-25 21:33:17 -07:00
2010-05-11 14:40:55 +02:00
2010-06-10 23:31:35 -07:00
2010-06-30 13:31:19 -07:00
2009-09-14 17:03:05 -07:00
2010-06-10 23:31:35 -07:00
2010-06-10 23:31:35 -07:00
2010-06-26 22:00:03 -07:00
2010-09-08 21:45:01 -07:00
2010-01-17 19:16:02 -08:00
2010-07-04 11:46:07 -07:00