Skip to content
  • Eric Dumazet's avatar
    tcp: fix potential memory corruption · ac9e70b1
    Eric Dumazet authored
    Imagine initial value of max_skb_frags is 17, and last
    skb in write queue has 15 frags.
    
    Then max_skb_frags is lowered to 14 or smaller value.
    
    tcp_sendmsg() will then be allowed to add additional page frags
    and eventually go past MAX_SKB_FRAGS, overflowing struct
    skb_shared_info.
    
    Fixes: 5f74f82e
    
     ("net:Add sysctl_max_skb_frags")
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
    Cc: Håkon Bugge <haakon.bugge@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ac9e70b1