android_kernel_xiaomi_sm8350/net/ipv4
Yan Zhai dbe64279ae lwt: Check LWTUNNEL_XMIT_CONTINUE strictly
[ Upstream commit a171fbec88a2c730b108c7147ac5e7b2f5a02b47 ]

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-23 10:59:42 +02:00
..
bpfilter
netfilter treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
af_inet.c tcp: deny tcp_disconnect() when threads are waiting 2023-06-09 10:28:53 +02:00
ah4.c
arp.c
cipso_ipv4.c
datagram.c
devinet.c
esp4_offload.c xfrm: Linearize the skb after offloading if needed. 2023-06-28 10:18:38 +02:00
esp4.c
fib_frontend.c ipv4: Fix incorrect table ID in IOCTL path 2023-03-22 13:28:06 +01:00
fib_lookup.h
fib_notifier.c
fib_rules.c
fib_semantics.c ipv4: Fix incorrect route flushing when source address is deleted 2023-02-22 12:50:38 +01:00
fib_trie.c
fou.c
gre_demux.c
gre_offload.c
icmp.c icmp: guard against too small mtu 2023-04-20 12:07:33 +02:00
igmp.c
inet_connection_sock.c tcp: deny tcp_disconnect() when threads are waiting 2023-06-09 10:28:53 +02:00
inet_diag.c
inet_fragment.c
inet_hashtables.c Revert "tcp: avoid the lookup process failing to get sk in ehash table" 2023-07-27 08:37:44 +02:00
inet_timewait_sock.c Revert "tcp: avoid the lookup process failing to get sk in ehash table" 2023-07-27 08:37:44 +02:00
inetpeer.c
ip_forward.c
ip_fragment.c
ip_gre.c ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode 2023-05-30 12:44:05 +01:00
ip_input.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:57:55 +01:00
ip_options.c
ip_output.c lwt: Check LWTUNNEL_XMIT_CONTINUE strictly 2023-09-23 10:59:42 +02:00
ip_sockglue.c ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-05 08:17:33 +02:00
ip_tunnel_core.c
ip_tunnel.c net: tunnels: annotate lockless accesses to dev->needed_headroom 2023-03-22 13:28:05 +01:00
ip_vti.c ip_vti: fix potential slab-use-after-free in decode_session6 2023-08-30 16:27:16 +02:00
ipcomp.c
ipconfig.c
ipip.c
ipmr_base.c
ipmr.c
Kconfig tcp: configurable source port perturb table size 2022-12-08 11:23:00 +01:00
Makefile
metrics.c ipv4: prevent potential spectre v1 gadget in ip_metrics_convert() 2023-02-06 07:52:45 +01:00
netfilter.c
netlink.c
nexthop.c nh: fix scope used to find saddr when adding non gw nh 2022-11-03 23:56:56 +09:00
ping.c
proc.c
protocol.c
raw_diag.c
raw.c ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-05 08:17:33 +02:00
route.c
syncookies.c
sysctl_net_ipv4.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:57:55 +01:00
tcp_bbr.c
tcp_bic.c
tcp_bpf.c bpf, sockmap: Fix data loss caused by using apply_bytes on ingress redirect 2023-01-18 11:41:08 +01:00
tcp_cdg.c tcp: cdg: allow tcp_cdg_release() to be called multiple times 2022-11-25 17:42:21 +01:00
tcp_cong.c
tcp_cubic.c
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp_fastopen.c tcp: annotate data-races around fastopenq.max_qlen 2023-07-27 08:37:45 +02:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: tcp_enter_quickack_mode() should be static 2023-09-23 10:59:41 +02:00
tcp_ipv4.c dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). 2022-12-08 11:22:59 +01:00
tcp_lp.c
tcp_metrics.c tcp_metrics: fix data-race in tcpm_suck_dst() vs fastopen 2023-08-11 11:53:58 +02:00
tcp_minisocks.c tcp: tcp_check_req() can be called from process context 2023-03-11 16:44:12 +01:00
tcp_nv.c
tcp_offload.c
tcp_output.c tcp: tcp_make_synack() can be called from process context 2023-03-22 13:28:04 +01:00
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c net: fix the RTO timer retransmitting skb every 1ms if linear option is enabled 2023-08-30 16:27:19 +02:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tcp.c tcp: annotate data-races around fastopenq.max_qlen 2023-07-27 08:37:45 +02:00
tunnel4.c
udp_diag.c
udp_impl.h
udp_offload.c
udp_tunnel.c net/tunnel: wait until all sk_user_data reader finish before releasing the sock 2023-01-18 11:41:14 +01:00
udp.c tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). 2023-04-26 11:24:05 +02:00
udplite.c udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). 2023-05-30 12:44:09 +01:00
xfrm4_input.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c