android_kernel_oneplus_msm8998/net/ipv6
Zhiqiang Liu 9467d98f6d net: fix IPv6 prefix route residue
[ Upstream commit e75913c93f7cd5f338ab373c34c93a655bd309cb ]

Follow those steps:
 # ip addr add 2001:123::1/32 dev eth0
 # ip addr add 2001:123:456::2/64 dev eth0
 # ip addr del 2001:123::1/32 dev eth0
 # ip addr del 2001:123:456::2/64 dev eth0
and then prefix route of 2001:123::1/32 will still exist.

This is because ipv6_prefix_equal in check_cleanup_prefix_route
func does not check whether two IPv6 addresses have the same
prefix length. If the prefix of one address starts with another
shorter address prefix, even though their prefix lengths are
different, the return value of ipv6_prefix_equal is true.

Here I add a check of whether two addresses have the same prefix
to decide whether their prefixes are equal.

Fixes: 5b84efecb7 ("ipv6 addrconf: don't cleanup prefix route for IFA_F_NOPREFIXROUTE")
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Reported-by: Wenhao Zhang <zhangwenhao8@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-23 09:05:13 +01:00
..
netfilter ip: frags: fix crash in ip_do_fragment() 2019-02-08 11:25:33 +01:00
addrconf.c net: fix IPv6 prefix route residue 2019-02-23 09:05:13 +01:00
addrconf_core.c
addrlabel.c
af_inet6.c ipv6: Consider sk_bound_dev_if when binding a socket to an address 2019-02-06 19:43:06 +01:00
ah6.c ipsec: check return value of skb_to_sgvec always 2018-04-13 19:50:23 +02:00
anycast.c
datagram.c ip: on queued skb use skb_header_pointer instead of pskb_may_pull 2019-01-26 09:42:49 +01:00
esp6.c ipsec: check return value of skb_to_sgvec always 2018-04-13 19:50:23 +02:00
exthdrs.c
exthdrs_core.c
exthdrs_offload.c
fib6_rules.c ipv6: Do not leak throw route references 2017-07-05 14:37:14 +02:00
icmp.c
ila.c
inet6_connection_sock.c
inet6_hashtables.c
ip6_checksum.c udplite: fix partial checksum initialization 2018-03-11 16:19:46 +01:00
ip6_fib.c ipv6: fix typo in fib6_net_exit() 2017-09-27 11:00:12 +02:00
ip6_flowlabel.c ipv6: flowlabel: do not leave opt->tot_len with garbage 2017-11-18 11:11:06 +01:00
ip6_gre.c ip6_gre: better validate user provided tunnel names 2018-04-13 19:50:26 +02:00
ip6_icmp.c
ip6_input.c
ip6_offload.c gso_segment: Reset skb->mac_len after modifying network header 2018-09-29 03:08:52 -07:00
ip6_offload.h
ip6_output.c ipv6: Check available headroom in ip6_xmit() even without options 2018-12-17 21:55:08 +01:00
ip6_tunnel.c ip6_tunnel: be careful when accessing the inner header 2018-10-20 09:52:36 +02:00
ip6_udp_tunnel.c ipv6: explicitly initialize udp6_addr in udp_sock_create6() 2019-01-13 10:05:27 +01:00
ip6_vti.c vti6: flush x-netns xfrm cache when vti interface is removed 2018-11-10 07:41:38 -08:00
ip6mr.c ip6mr: Fix potential Spectre v1 vulnerability 2019-01-13 10:05:27 +01:00
ipcomp6.c
ipv6_sockglue.c netfilter: drop outermost socket lock in getsockopt() 2018-02-28 10:17:21 +01:00
Kconfig ipv4+ipv6: Make INET*_ESP select CRYPTO_ECHAINIV 2018-08-15 17:42:05 +02:00
Makefile
mcast.c ipv6: mcast: fix a use-after-free in inet6_mc_check 2018-11-10 07:41:41 -08:00
mcast_snoop.c
mip6.c
ndisc.c ipv6/ndisc: Preserve IPv6 control buffer if protocol error handlers are called 2018-11-10 07:41:41 -08:00
netfilter.c
output_core.c ipv6: accept 64k - 1 packet length in ip6_find_1stfragopt() 2017-09-27 11:00:10 +02:00
ping.c
proc.c inet: frags: break the 2GB limit for frags storage 2019-02-08 11:25:31 +01:00
protocol.c
raw.c
reassembly.c ip: use rb trees for IP frag queue. 2019-02-08 11:25:32 +01:00
route.c ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF 2018-11-27 16:07:57 +01:00
sit.c Revert "sit: reload iphdr in ipip6_rcv" 2018-07-22 14:25:52 +02:00
syncookies.c ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check() 2017-08-11 09:08:51 -07:00
sysctl_net_ipv6.c
tcp_ipv6.c tcp: increment sk_drops for dropped rx packets 2018-10-13 09:11:34 +02:00
tcpv6_offload.c
tunnel6.c
udp.c udpv6: Fix the checksum computation when HW checksum does not apply 2017-10-21 17:09:02 +02:00
udp_impl.h
udp_offload.c net: avoid skb_warn_bad_offload false positives on UFO 2017-08-12 19:29:08 -07:00
udplite.c
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c xfrm6: call kfree_skb when skb is toobig 2018-11-10 07:41:32 -08:00
xfrm6_policy.c xfrm6: avoid potential infinite loop in _decode_session6() 2018-07-03 11:21:24 +02:00
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi 2019-02-20 10:13:10 +01:00