Skip to content
  • Herbert Xu's avatar
    [TCP]: Fix sk_forward_alloc underflow in tcp_sendmsg · ef015786
    Herbert Xu authored
    
    
    I've finally found a potential cause of the sk_forward_alloc underflows
    that people have been reporting sporadically.
    
    When tcp_sendmsg tacks on extra bits to an existing TCP_PAGE we don't
    check sk_forward_alloc even though a large amount of time may have
    elapsed since we allocated the page.  In the mean time someone could've
    come along and liberated packets and reclaimed sk_forward_alloc memory.
    
    This patch makes tcp_sendmsg check sk_forward_alloc every time as we
    do in do_tcp_sendpages.
     
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ef015786