diff options
author | Eric Dumazet <edumazet@google.com> | 2013-03-14 05:40:32 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-03-27 02:41:06 +0000 |
commit | 3bb4aac6d51817928a722617d218d2d67aa11373 (patch) | |
tree | c4b885df7f41910da2d1174bb86f35a95deb6803 /include | |
parent | f43dc583024e3d5c8bfb71afd3d5070131b27025 (diff) |
tcp: fix skb_availroom()
[ Upstream commit 16fad69cfe4adbbfa813de516757b87bcae36d93 ]
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 53dc7e79d72..da658902e04 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -455,7 +455,7 @@ struct sk_buff { union { __u32 mark; __u32 dropcount; - __u32 avail_size; + __u32 reserved_tailroom; }; __u16 vlan_tci; @@ -1332,7 +1332,10 @@ static inline int skb_tailroom(const struct sk_buff *skb) */ static inline int skb_availroom(const struct sk_buff *skb) { - return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; + if (skb_is_nonlinear(skb)) + return 0; + + return skb->end - skb->tail - skb->reserved_tailroom; } /** |