linux/net/core
Eric Dumazet 7fa93e39fb tcp: fix skb_copy_ubufs() vs BIG TCP
[ Upstream commit 7e692df393 ]

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: 7c4e983c4f ("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>
2023-05-17 11:53:32 +02:00
..
bpf_sk_storage.c
datagram.c
dev_addr_lists_test.c
dev_addr_lists.c
dev_ioctl.c
dev.c net: openvswitch: fix race on port output 2023-04-20 12:35:09 +02:00
dev.h
devlink.c
drop_monitor.c
dst_cache.c
dst.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: bpf_fib_lookup should not return neigh in NUD_FAILED state 2023-03-03 11:52:23 +01:00
flow_dissector.c
flow_offload.c
gen_estimator.c
gen_stats.c
gro_cells.c
gro.c skb: Do mix page pool and page referenced frags in GRO 2023-02-09 11:28:05 +01:00
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c neigh: make sure used and confirmed times are valid 2023-03-03 11:52:22 +01:00
net_namespace.c net: fix UaF in netns ops registration error path 2023-02-01 08:34:43 +01:00
net-procfs.c
net-sysfs.c
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c net: don't let netpoll invoke NAPI if in xmit context 2023-04-13 16:55:21 +02:00
netprio_cgroup.c
of_net.c
page_pool.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c
scm.c scm: add user copy checks to put_cmsg() 2023-03-10 09:33:54 +01:00
secure_seq.c
selftests.c
skbuff.c tcp: fix skb_copy_ubufs() vs BIG TCP 2023-05-17 11:53:32 +02:00
skmsg.c
sock_destructor.h
sock_diag.c
sock_map.c bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap 2023-05-11 23:03:22 +09:00
sock_reuseport.c
sock.c net: use indirect calls helpers for sk_exit_memory_pressure() 2023-03-17 08:50:24 +01:00
stream.c net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). 2023-03-03 11:52:23 +01:00
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c