Subject: Re: [TCP]: Fix truesize underflow

From: Stephen Hemminger <[email-masked]>
Date: Wed, 19 Apr 2006 09:53:48 -0700

On Tue, 18 Apr 2006 22:32:04 +1000
Herbert Xu <[email-masked]> wrote:

> Hi Dave:
> 
> You're absolutely right about there being a problem with the TSO packet
> trimming code.  The cause of this lies in the tcp_fragment() function.
> 
> When we allocate a fragment for a completely non-linear packet the
> truesize is calculated for a payload length of zero.  This means that
> truesize could in fact be less than the real payload length.
> 
> When that happens the TSO packet trimming can cause truesize to become
> negative.  This in turn can cause sk_forward_alloc to be -n * PAGE_SIZE
> which would trigger the warning.
> 
> I've copied the code you used in tso_fragment which should work here.
> 
> Signed-off-by: Herbert Xu <[email-masked]>
> 
> Everyone who's having the sk_forward_alloc warning problem should give
> this patch a go to see if it cures things.
> 
> Just in case this still doesn't fix it, could everyone please also verify
> whether disabling SMP has any effect on reproducing this?
> 
> Thanks,

Please put this in the next -stable load...