linux-stable/net/ipv6
Yan Zhai d8f5415d4d lwt: Check LWTUNNEL_XMIT_CONTINUE strictly
[ Upstream commit a171fbec88 ]

LWTUNNEL_XMIT_CONTINUE is implicitly assumed in ip(6)_finish_output2,
such that any positive return value from a xmit hook could cause
unexpected continue behavior, despite that related skb may have been
freed. This could be error-prone for future xmit hook ops. One of the
possible errors is to return statuses of dst_output directly.

To make the code safer, redefine LWTUNNEL_XMIT_CONTINUE value to
distinguish from dst_output statuses and check the continue
condition explicitly.

Fixes: 3a0af8fd61 ("bpf: BPF for lightweight tunnel infrastructure")
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Yan Zhai <yan@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/96b939b85eda00e8df4f7c080f770970a4c5f698.1692326837.git.yan@cloudflare.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:20:09 +02:00
..
ila ila: do not generate empty messages in ila_xlat_nl_cmd_get_mapping() 2023-03-17 08:45:10 +01:00
netfilter netfilter: tproxy: fix deadlock due to missing BH disable 2023-03-17 08:45:11 +01:00
addrconf.c ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address 2023-08-11 11:57:35 +02:00
addrconf_core.c
addrlabel.c ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network 2022-11-16 09:57:11 +01:00
af_inet6.c dccp: Call inet6_destroy_sock() via sk->sk_destruct(). 2023-04-26 11:27:42 +02:00
ah6.c xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume 2021-04-14 08:42:05 +02:00
anycast.c
calipso.c cipso,calipso: resolve a number of problems with the DOI refcounts 2021-03-17 17:06:15 +01:00
datagram.c ipv6: Fix datagram socket connection with DSCP. 2023-02-22 12:55:58 +01:00
esp6.c esp: limit skb_page_frag_refill use to a single page 2022-04-27 13:53:48 +02:00
esp6_offload.c xfrm: Linearize the skb after offloading if needed. 2023-06-28 10:28:11 +02:00
exthdrs.c ipv6: rpl: Fix Route of Death. 2023-06-14 11:09:42 +02:00
exthdrs_core.c ipv6: Fix out-of-bounds access in ipv6_find_tlv() 2023-05-30 12:57:58 +01:00
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c ipv6: fix memory leak in fib6_rule_suppress 2021-12-08 09:03:21 +01:00
fou6.c
icmp.c icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev(). 2023-07-27 08:44:21 +02:00
inet6_connection_sock.c lsm,selinux: pass flowi_common instead of flowi to the LSM hooks 2022-06-09 10:21:09 +02:00
inet6_hashtables.c ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH() 2022-08-21 15:15:51 +02:00
ip6_checksum.c
ip6_fib.c ipv6: annotate accesses to fn->fn_sernum 2022-02-01 17:25:44 +01:00
ip6_flowlabel.c ipv6: per-netns exclusive flowlabel checks 2022-02-23 12:01:01 +01:00
ip6_gre.c net:ipv6: check return value of pskb_trim() 2023-07-27 08:44:40 +02:00
ip6_icmp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 11:38:46 +01:00
ip6_input.c tcp/udp: Make early_demux back namespacified. 2022-11-10 18:14:26 +01:00
ip6_offload.c gso: do not skip outer ip header in case of ipip and net_failover 2022-03-02 11:42:49 +01:00
ip6_offload.h
ip6_output.c lwt: Check LWTUNNEL_XMIT_CONTINUE strictly 2023-09-19 12:20:09 +02:00
ip6_tunnel.c net: tunnels: annotate lockless accesses to dev->needed_headroom 2023-03-22 13:29:58 +01:00
ip6_udp_tunnel.c
ip6_vti.c ip6_vti: fix slab-use-after-free in decode_session6 2023-08-26 15:26:52 +02:00
ip6mr.c ip6mr: Fix skb_under_panic in ip6mr_cache_report() 2023-08-11 11:57:50 +02:00
ipcomp6.c
ipv6_sockglue.c udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM). 2023-04-26 11:27:41 +02:00
Kconfig
Makefile
mcast.c mld: fix panic in mld_newpack() 2021-06-03 09:00:48 +02:00
mcast_snoop.c net: bridge: mcast: fix broken length + header check for MRDv6 Adv. 2021-05-14 09:50:44 +02:00
mip6.c
ndisc.c ipv6: adjust ndisc_is_useropt() to also return true for PIO 2023-08-16 18:20:59 +02:00
netfilter.c
output_core.c ipv6: use prandom_u32() for ID generation 2021-07-19 09:44:44 +02:00
ping.c ping6: Fix send to link-local addresses with VRF. 2023-06-21 15:45:38 +02:00
proc.c
protocol.c
raw.c ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-05 09:07:04 +02:00
reassembly.c ipv6: record frag_max_size in atomic fragments in input path 2021-06-03 09:00:50 +02:00
route.c ipv6: Add lwtunnel encap size of all siblings in nexthop calculation 2023-03-11 16:40:12 +01:00
rpl.c net: rpl: fix rpl header size calculation 2023-04-26 11:27:36 +02:00
rpl_iptunnel.c
seg6.c ipv6: sr: fix out-of-bounds read when setting HMAC data. 2022-09-15 11:32:05 +02:00
seg6_hmac.c net: ipv6: unexport __init-annotated seg6_hmac_net_init() 2022-07-07 17:52:17 +02:00
seg6_iptunnel.c seg6: fix skb checksum evaluation in SRH encapsulation/insertion 2022-07-21 21:20:11 +02:00
seg6_local.c seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors 2022-07-21 21:20:11 +02:00
sit.c sit: update dev->needed_headroom in ipip6_tunnel_bind_dev() 2023-05-17 11:48:10 +02:00
syncookies.c tcp: Fix data-races around sysctl_tcp_syncookies. 2022-07-29 17:19:16 +02:00
sysctl_net_ipv6.c
tcp_ipv6.c tcp: annotate data-races around tcp_rsk(req)->ts_recent 2023-07-27 08:44:40 +02:00
tcpv6_offload.c
tunnel6.c
udp.c udp: re-score reuseport groups when connected sockets are present 2023-09-19 12:20:08 +02:00
udp_impl.h tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). 2023-04-26 11:27:41 +02:00
udp_offload.c udp: ipv4: manipulate network header of NATed UDP GRO fraglist 2021-02-10 09:29:23 +01:00
udplite.c udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). 2023-05-30 12:57:57 +01:00
xfrm6_input.c xfrm: fix inbound ipv4/udp/esp packets to UDPv6 dualstack sockets 2023-06-28 10:28:10 +02:00
xfrm6_output.c xfrm: fix tunnel model fragmentation behavior 2022-04-08 14:39:47 +02:00
xfrm6_policy.c xfrm: Fix ignored return value in xfrm6_init() 2022-12-02 17:40:01 +01:00
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c