]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ip_fragment: also adjust skb->truesize for packets not owned by a socket
authorPatrick McHardy <kaber@trash.net>
Tue, 1 Dec 2009 23:53:57 +0000 (15:53 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:54 +0000 (13:43 -0800)
commitb1589c33ceab093fc7b5cb21b5116bc15965b081
tree26e49a90263b1c796e1e899b6b909a1e64f9b64b
parentffa495ef3bad15580cfa8c119d15fe0227ee629c
ip_fragment: also adjust skb->truesize for packets not owned by a socket

[ Upstream commit b2722b1c3a893ec6021508da15b32282ec79f4da ]

When a large packet gets reassembled by ip_defrag(), the head skb
accounts for all the fragments in skb->truesize. If this packet is
refragmented again, skb->truesize is not re-adjusted to reflect only
the head size since its not owned by a socket. If the head fragment
then gets recycled and reused for another received fragment, it might
exceed the defragmentation limits due to its large truesize value.

skb_recycle_check() explicitly checks for linear skbs, so any recycled
skb should reflect its true size in skb->truesize. Change ip_fragment()
to also adjust the truesize value of skbs not owned by a socket.

Reported-and-tested-by: Ben Menchaca <ben@bigfootnetworks.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/ip_output.c