aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-03-14 01:40:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-14 11:49:45 -0400
commit16fad69cfe4adbbfa813de516757b87bcae36d93 (patch)
tree5b16184db33e16e398fa88ca1dcbb4f054fdaffa /include
parentb701f16dd490d3f346724050f17d60beda094998 (diff)
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 'include')
-rw-r--r--include/linux/skbuff.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 821c7f45d2a7..6f2bb860e051 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -500,7 +500,7 @@ struct sk_buff {
500 union { 500 union {
501 __u32 mark; 501 __u32 mark;
502 __u32 dropcount; 502 __u32 dropcount;
503 __u32 avail_size; 503 __u32 reserved_tailroom;
504 }; 504 };
505 505
506 sk_buff_data_t inner_transport_header; 506 sk_buff_data_t inner_transport_header;
@@ -1447,7 +1447,10 @@ static inline int skb_tailroom(const struct sk_buff *skb)
1447 */ 1447 */
1448static inline int skb_availroom(const struct sk_buff *skb) 1448static inline int skb_availroom(const struct sk_buff *skb)
1449{ 1449{
1450 return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; 1450 if (skb_is_nonlinear(skb))
1451 return 0;
1452
1453 return skb->end - skb->tail - skb->reserved_tailroom;
1451} 1454}
1452 1455
1453/** 1456/**