diff options
author | Eric Dumazet <edumazet@google.com> | 2013-03-14 06:40:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-14 16:49:45 +0100 |
commit | 16fad69cfe4adbbfa813de516757b87bcae36d93 (patch) | |
tree | 5b16184db33e16e398fa88ca1dcbb4f054fdaffa /net/ipv4/tcp.c | |
parent | net: qmi_wwan: set correct altsetting for Gobi 1K devices (diff) | |
download | linux-16fad69cfe4adbbfa813de516757b87bcae36d93.tar.xz linux-16fad69cfe4adbbfa813de516757b87bcae36d93.zip |
tcp: fix skb_availroom()
Chrome OS team reported a crash on a Pixel ChromeBook in TCP stack :
https://code.google.com/p/chromium/issues/detail?id=182056
commit a21d45726acac (tcp: avoid order-1 allocations on wifi and tx
path) did a poor choice adding an 'avail_size' field to skb, while
what we really needed was a 'reserved_tailroom' one.
It would have avoided commit 22b4a4f22da (tcp: fix retransmit of
partially acked frames) and this commit.
Crash occurs because skb_split() is not aware of the 'avail_size'
management (and should not be aware)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Mukesh Agrawal <quiche@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 47e854fcae24..e22020790709 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -775,7 +775,7 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp) * Make sure that we have exactly size bytes * available to the caller, no more, no less. */ - skb->avail_size = size; + skb->reserved_tailroom = skb->end - skb->tail - size; return skb; } __kfree_skb(skb); |