Commit 7fa93e3
tcp: fix skb_copy_ubufs() vs BIG TCP
[ Upstream commit 7e692df ]
David Ahern reported crashes in skb_copy_ubufs() caused by TCP tx zerocopy
using hugepages, and skb length bigger than ~68 KB.
skb_copy_ubufs() assumed it could copy all payload using up to
MAX_SKB_FRAGS order-0 pages.
This assumption broke when BIG TCP was able to put up to 512 KB per skb.
We did not hit this bug at Google because we use CONFIG_MAX_SKB_FRAGS=45
and limit gso_max_size to 180000.
A solution is to use higher order pages if needed.
v2: add missing __GFP_COMP, or we leak memory.
Fixes: 7c4e983 ("net: allow gso_max_size to exceed 65536")
Reported-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/netdev/c70000f6-baa4-4a05-46d0-4b3e0dc1ccc8@gmail.com/T/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Xin Long <lucien.xin@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Coco Li <lixiaoyan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 449280a commit 7fa93e3
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1544 | 1544 | | |
1545 | 1545 | | |
1546 | 1546 | | |
1547 | | - | |
| 1547 | + | |
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
| |||
1553 | 1553 | | |
1554 | 1554 | | |
1555 | 1555 | | |
1556 | | - | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1557 | 1565 | | |
1558 | | - | |
| 1566 | + | |
1559 | 1567 | | |
1560 | 1568 | | |
1561 | 1569 | | |
| |||
1582 | 1590 | | |
1583 | 1591 | | |
1584 | 1592 | | |
1585 | | - | |
| 1593 | + | |
1586 | 1594 | | |
1587 | 1595 | | |
1588 | 1596 | | |
1589 | | - | |
| 1597 | + | |
1590 | 1598 | | |
1591 | 1599 | | |
1592 | 1600 | | |
| |||
1602 | 1610 | | |
1603 | 1611 | | |
1604 | 1612 | | |
1605 | | - | |
| 1613 | + | |
1606 | 1614 | | |
1607 | 1615 | | |
1608 | 1616 | | |
| |||
0 commit comments