Commit 3c77a37
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 074df40 commit 3c77a37
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
1611 | | - | |
| 1611 | + | |
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
| |||
1617 | 1617 | | |
1618 | 1618 | | |
1619 | 1619 | | |
1620 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
1621 | 1629 | | |
1622 | | - | |
| 1630 | + | |
1623 | 1631 | | |
1624 | 1632 | | |
1625 | 1633 | | |
| |||
1646 | 1654 | | |
1647 | 1655 | | |
1648 | 1656 | | |
1649 | | - | |
| 1657 | + | |
1650 | 1658 | | |
1651 | 1659 | | |
1652 | 1660 | | |
1653 | | - | |
| 1661 | + | |
1654 | 1662 | | |
1655 | 1663 | | |
1656 | 1664 | | |
| |||
1666 | 1674 | | |
1667 | 1675 | | |
1668 | 1676 | | |
1669 | | - | |
| 1677 | + | |
1670 | 1678 | | |
1671 | 1679 | | |
1672 | 1680 | | |
| |||
0 commit comments