Commit 9cd62f0
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 27d5e46 commit 9cd62f0
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1705 | 1705 | | |
1706 | 1706 | | |
1707 | 1707 | | |
1708 | | - | |
| 1708 | + | |
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
| |||
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | | - | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
1718 | 1726 | | |
1719 | | - | |
| 1727 | + | |
1720 | 1728 | | |
1721 | 1729 | | |
1722 | 1730 | | |
| |||
1743 | 1751 | | |
1744 | 1752 | | |
1745 | 1753 | | |
1746 | | - | |
| 1754 | + | |
1747 | 1755 | | |
1748 | 1756 | | |
1749 | 1757 | | |
1750 | | - | |
| 1758 | + | |
1751 | 1759 | | |
1752 | 1760 | | |
1753 | 1761 | | |
| |||
1763 | 1771 | | |
1764 | 1772 | | |
1765 | 1773 | | |
1766 | | - | |
| 1774 | + | |
1767 | 1775 | | |
1768 | 1776 | | |
1769 | 1777 | | |
| |||
0 commit comments