]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[NET]: Update frag_list in pskb_trim
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 14 Jul 2006 02:26:39 +0000 (19:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jul 2006 02:26:39 +0000 (19:26 -0700)
commit27b437c8b7d519aac70a0254c2e04c29eff565a2
tree2391668d15da8a33fabd46ddf09594baa3c4b27e
parentab6cf0d0cb96417ef65cc2c2120c0e879edf7a4a
[NET]: Update frag_list in pskb_trim

When pskb_trim has to defer to ___pksb_trim to trim the frag_list part of
the packet, the frag_list is not updated to reflect the trimming.  This
will usually work fine until you hit something that uses the packet length
or tail from the frag_list.

Examples include esp_output and ip_fragment.

Another problem caused by this is that you can end up with a linear packet
with a frag_list attached.

It is possible to get away with this if we audit everything to make sure
that they always consult skb->len before going down onto frag_list.  In
fact we can do the samething for the paged part as well to avoid copying
the data area of the skb.  For now though, let's do the conservative fix
and update frag_list.

Many thanks to Marco Berizzi for helping me to track down this bug.

This 4-year old bug took 3 months to track down.  Marco was very patient
indeed :)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c