linux-stable/net/ipv6
Shiming Cheng 95db6e62a2 ipv6: fib6_rules: flush route cache when rule is changed
[ Upstream commit c4386ab4f6 ]

When rule policy is changed, ipv6 socket cache is not refreshed.
The sock's skb still uses a outdated route cache and was sent to
a wrong interface.

To avoid this error we should update fib node's version when
rule is changed. Then skb's route will be reroute checked as
route cache version is already different with fib node version.
The route cache is refreshed to match the latest rule.

Fixes: 101367c2f8 ("[IPV6]: Policy Routing Rules")
Signed-off-by: Shiming Cheng <shiming.cheng@mediatek.com>
Signed-off-by: Lena Wang <lena.wang@mediatek.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:22:36 -04:00
..
ila ila: do not generate empty messages in ila_xlat_nl_cmd_get_mapping() 2023-03-17 08:31:44 +01:00
netfilter treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
Kconfig net: ipv6: fix kconfig dependency warning for IPV6_SEG6_HMAC 2020-09-26 18:01:29 +02:00
Makefile
addrconf.c net: ipv6/addrconf: avoid integer underflow in ipv6_create_tempaddr 2023-09-23 10:48:13 +02:00
addrconf_core.c ipv6: Ensure natural alignment of const ipv6 loopback and router addresses 2024-02-23 08:12:52 +01:00
addrlabel.c ipv6: addrlabel: fix infoleak when sending struct ifaddrlblmsg to network 2022-11-25 17:40:17 +01:00
af_inet6.c dccp: Call inet6_destroy_sock() via sk->sk_destruct(). 2023-04-26 11:21:53 +02:00
ah6.c ah6: fix error return code in ah6_input() 2020-11-24 13:27:15 +01:00
anycast.c ipv6: fix memory leaks on IPV6_ADDRFORM path 2020-08-11 15:32:34 +02:00
calipso.c cipso,calipso: resolve a number of problems with the DOI refcounts 2021-03-17 16:43:44 +01:00
datagram.c ipv6: Fix datagram socket connection with DSCP. 2023-02-22 12:47:21 +01:00
esp6.c net: ipv6: fix return value check in esp_remove_trailer 2023-10-25 11:16:45 +02:00
esp6_offload.c xfrm: Linearize the skb after offloading if needed. 2023-06-28 10:15:29 +02:00
exthdrs.c ipv6: fix out-of-bound access in ip6_parse_tlv() 2021-07-20 16:15:52 +02:00
exthdrs_core.c ipv6: Fix out-of-bounds access in ipv6_find_tlv() 2023-05-30 12:42:14 +01:00
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c ipv6: fib6_rules: flush route cache when rule is changed 2024-03-26 18:22:36 -04:00
fou6.c
icmp.c icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev(). 2023-08-11 11:45:18 +02:00
inet6_connection_sock.c net: ipv6: add net argument to ip6_dst_lookup_flow 2020-04-29 16:31:16 +02:00
inet6_hashtables.c secure_seq: use the 64 bits of the siphash for port offset calculation 2022-06-06 08:24:20 +02:00
ip6_checksum.c
ip6_fib.c ipv6: fix potential NULL deref in fib6_add() 2023-12-13 17:42:16 +01:00
ip6_flowlabel.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ip6_gre.c net:ipv6: check return value of pskb_trim() 2023-08-11 11:45:26 +02:00
ip6_icmp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 09:39:59 +01:00
ip6_input.c tcp/udp: Make early_demux back namespacified. 2022-11-10 17:46:54 +01:00
ip6_offload.c gso: do not skip outer ip header in case of ipip and net_failover 2022-03-02 11:38:12 +01:00
ip6_offload.h
ip6_output.c ipv6: avoid atomic fragment on GSO packets 2023-11-20 10:29:17 +01:00
ip6_tunnel.c ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim() 2024-01-25 14:33:35 -08:00
ip6_udp_tunnel.c
ip6_vti.c ip6_vti: fix slab-use-after-free in decode_session6 2023-08-30 16:31:48 +02:00
ip6mr.c ip6mr: Fix skb_under_panic in ip6mr_cache_report() 2023-08-11 11:45:37 +02:00
ipcomp6.c
ipv6_sockglue.c udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM). 2023-04-26 11:21:52 +02:00
mcast.c mld: fix panic in mld_newpack() 2021-06-03 08:38:11 +02:00
mcast_snoop.c
mip6.c
ndisc.c ipv6: adjust ndisc_is_useropt() to also return true for PIO 2023-08-16 18:12:59 +02:00
netfilter.c netfilter: use actual socket sk rather than skb sk when routing harder 2020-11-18 19:18:44 +01:00
output_core.c ipv6: use prandom_u32() for ID generation 2021-07-20 16:16:00 +02:00
ping.c ping6: Fix send to link-local addresses with VRF. 2023-06-21 15:39:58 +02:00
proc.c
protocol.c
raw.c ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-09 10:23:54 +02:00
reassembly.c vrf: Increment Icmp6InMsgs on the original netdev 2023-08-11 11:45:18 +02:00
route.c net/ipv6: avoid possible UAF in ip6_route_mpath_notify() 2024-03-15 10:48:14 -04:00
seg6.c ipv6: sr: fix possible use-after-free and null-ptr-deref 2024-03-01 13:06:11 +01:00
seg6_hmac.c net: ipv6: unexport __init-annotated seg6_hmac_net_init() 2022-07-07 17:35:10 +02:00
seg6_iptunnel.c seg6: fix skb checksum evaluation in SRH encapsulation/insertion 2022-07-21 21:09:29 +02:00
seg6_local.c seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors 2022-07-21 21:09:29 +02:00
sit.c sit: update dev->needed_headroom in ipip6_tunnel_bind_dev() 2023-05-17 11:13:23 +02:00
syncookies.c dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 10:29:21 +01:00
sysctl_net_ipv6.c
tcp_ipv6.c inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy(). 2023-04-26 11:21:53 +02:00
tcpv6_offload.c
tunnel6.c
udp.c udp6: fix udp6_ehashfn() typo 2023-08-11 11:45:18 +02:00
udp_impl.h tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct(). 2023-04-26 11:21:52 +02:00
udp_offload.c
udplite.c udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated(). 2023-05-30 12:42:14 +01:00
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c xfrm: fix tunnel model fragmentation behavior 2022-04-15 14:14:36 +02:00
xfrm6_policy.c xfrm6: fix inet6_dev refcount underflow problem 2023-10-25 11:17:03 +02:00
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c xfrm: clean up xfrm protocol checks 2019-05-25 18:23:41 +02:00