linux-stable/net/core
Steffen Klassert 2c8abafd6c esp: Fix possible buffer overflow in ESP transformation
commit ebe48d368e upstream.

The maximum message size that can be send is bigger than
the  maximum site that skb_page_frag_refill can allocate.
So it is possible to write beyond the allocated buffer.

Fix this by doing a fallback to COW in that case.

v2:

Avoid get get_order() costs as suggested by Linus Torvalds.

Fixes: cac2661c53 ("esp4: Avoid skb_cow_data whenever possible")
Fixes: 03e2a30f6a ("esp6: Avoid skb_cow_data whenever possible")
Reported-by: valis <sec@valis.email>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-28 08:22:26 +02:00
..
datagram.c net: use skb_queue_empty_lockless() in busy poll contexts 2019-11-10 11:25:35 +01:00
dev.c gro: ensure frag0 meets IP header alignment 2021-08-04 12:22:15 +02:00
dev_addr_lists.c net: fix uninit-value in __hw_addr_add_ex() 2018-05-16 10:10:23 +02:00
dev_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
devlink.c devlink: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill() 2020-11-24 13:05:36 +01:00
drop_monitor.c drop_monitor: fix data-race in dropmon_net_event / trace_napi_poll_hit 2022-02-23 11:57:34 +01:00
dst.c net: check type when freeing metadata dst 2017-08-21 10:57:38 -07:00
dst_cache.c
ethtool.c ethtool: reduce stack usage with clang 2020-01-17 19:45:40 +01:00
fib_notifier.c net: Add module reference to FIB notifiers 2017-09-01 20:33:42 -07:00
fib_rules.c fib: Return the correct errno code 2021-06-30 08:48:47 -04:00
filter.c bpf: fix truncated jump targets on heavy expansions 2022-02-08 18:16:27 +01:00
flow_dissector.c flow_dissector: Fix out-of-bounds warnings 2021-09-22 11:45:28 +02:00
gen_estimator.c net_sched: gen_estimator: support large ewma log 2021-02-07 14:47:40 +01:00
gen_stats.c gen_stats: Fix netlink stats dumping in the presence of padding 2018-07-25 11:25:09 +02:00
gro_cells.c gro_cells: make sure device is up in gro_cells_receive() 2019-03-19 13:13:21 +01:00
hwbm.c
link_watch.c
lwt_bpf.c bpf: in __bpf_redirect_no_mac pull mac only if present 2019-01-23 08:09:50 +01:00
lwtunnel.c ipv6: sr: define core operations for seg6local lightweight tunnel 2017-08-07 14:16:22 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
neighbour.c net, neigh: clear whole pneigh_entry at alloc time 2021-12-14 10:16:55 +01:00
net-procfs.c net-procfs: show net devices bound packet types 2022-02-08 18:16:26 +01:00
net-sysfs.c net-sysfs: add check for netdevice being present to speed_show 2022-03-16 12:57:08 +01:00
net-sysfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net_namespace.c netns: add schedule point in ops_exit_list() 2022-01-27 09:01:00 +01:00
netclassid_cgroup.c cgroup, netclassid: remove double cond_resched 2020-05-10 10:29:03 +02:00
netevent.c
netpoll.c net: Have netpoll bring-up DSA management interface 2020-11-24 13:05:39 +01:00
netprio_cgroup.c netprio_cgroup: Fix unlimited memory leak of v2 cgroups 2020-05-20 08:17:13 +02:00
pktgen.c pktgen: fix misuse of BUG_ON() in pktgen_thread_worker() 2021-03-07 11:27:44 +01:00
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink() 2022-02-08 18:16:27 +01:00
scm.c
secure_seq.c
skbuff.c net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends 2022-03-02 11:33:54 +01:00
sock.c esp: Fix possible buffer overflow in ESP transformation 2022-03-28 08:22:26 +02:00
sock_diag.c net: core: fix module type in sock_diag_bind 2018-01-17 09:45:21 +01:00
sock_reuseport.c soreuseport: fix mem leak in reuseport_add_sock() 2018-02-13 10:19:48 +01:00
stream.c net: stream: don't purge sk_error_queue in sk_stream_kill_queues() 2021-11-26 11:40:30 +01:00
sysctl_net_core.c bpf: Prevent increasing bpf_jit_limit above max 2021-11-26 11:40:22 +01:00
timestamping.c
tso.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
utils.c net: Fix skb->csum update in inet_proto_csum_replace16(). 2020-02-05 14:18:28 +00:00