Commit 7e692df
tcp: fix skb_copy_ubufs() vs BIG TCP
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>1 parent 6f75cd1 commit 7e692df
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1758 | 1758 | | |
1759 | 1759 | | |
1760 | 1760 | | |
1761 | | - | |
| 1761 | + | |
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
| |||
1767 | 1767 | | |
1768 | 1768 | | |
1769 | 1769 | | |
1770 | | - | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1771 | 1779 | | |
1772 | | - | |
| 1780 | + | |
1773 | 1781 | | |
1774 | 1782 | | |
1775 | 1783 | | |
| |||
1796 | 1804 | | |
1797 | 1805 | | |
1798 | 1806 | | |
1799 | | - | |
| 1807 | + | |
1800 | 1808 | | |
1801 | 1809 | | |
1802 | 1810 | | |
1803 | | - | |
| 1811 | + | |
1804 | 1812 | | |
1805 | 1813 | | |
1806 | 1814 | | |
| |||
1816 | 1824 | | |
1817 | 1825 | | |
1818 | 1826 | | |
1819 | | - | |
| 1827 | + | |
1820 | 1828 | | |
1821 | 1829 | | |
1822 | 1830 | | |
| |||
0 commit comments