android_kernel_google_msm/net/ipv6
Xin Long 103a20d70a ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
[ Upstream commit 99253eb750fda6a644d5188fb26c43bad8d5a745 ]

Commit 5e1859fbcc ("ipv4: ipmr: various fixes and cleanups") fixed
the issue for ipv4 ipmr:

  ip_mroute_setsockopt() & ip_mroute_getsockopt() should not
  access/set raw_sk(sk)->ipmr_table before making sure the socket
  is a raw socket, and protocol is IGMP

The same fix should be done for ipv6 ipmr as well.

This patch can fix the panic caused by overwriting the same offset
as ipmr_table as in raw_sk(sk) when accessing other type's socket
by ip_mroute_setsockopt().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I8d48f4611a2f2d0cb7ad5146036f571f12ecb1fc
CVE-2017-18509
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2023-02-18 18:38:56 +01:00
..
netfilter netfilter: xt_rpfilter: depend on raw or mangle table 2018-12-07 22:04:24 +04:00
Kconfig
Makefile Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
addrconf.c net: Explicitly initialize u64_stats_sync structures for lockdep 2020-11-30 19:26:40 +03:00
addrconf_core.c
addrlabel.c ipv6/addrlabel: fix ip6addrlbl_get() 2016-10-26 23:15:41 +08:00
af_inet6.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
ah6.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
anycast.c ipv6: clean up anycast when an interface is destroyed 2016-10-29 23:12:33 +08:00
datagram.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
esp6.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
exthdrs.c ipv6: add complete rcu protection around np->opt 2016-06-17 02:54:32 +00:00
exthdrs_core.c
fib6_rules.c
icmp.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
inet6_connection_sock.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
inet6_hashtables.c net: do not call sock_put() on TIMEWAIT sockets 2013-11-04 04:23:40 -08:00
ip6_fib.c ipv6: update ip6_rt_last_gc every time GC is run 2016-10-26 23:15:43 +08:00
ip6_flowlabel.c
ip6_input.c ipv6: add option to drop unicast encapsulated in L2 multicast 2018-12-07 21:59:38 +04:00
ip6_output.c BACKPORT: net: sock: make sock_tx_timestamp void 2023-02-18 18:32:19 +01:00
ip6_tunnel.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
ip6mr.c ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt 2023-02-18 18:38:56 +01:00
ipcomp6.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
ipv6_sockglue.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
mcast.c ipv6: some ipv6 statistic counters failed to disable bh 2014-04-26 17:13:18 -07:00
mip6.c ipv6: mip6: fix mip6_mh_filter() 2012-10-13 05:38:45 +09:00
ndisc.c ipv6: add option to drop unsolicited neighbor advertisements 2018-12-07 21:59:38 +04:00
netfilter.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
output_core.c drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets 2015-02-02 17:05:26 +08:00
ping.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
proc.c
protocol.c
raw.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
reassembly.c ipv6: drop packets with multiple fragmentation headers 2013-09-14 06:02:10 -07:00
route.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
sit.c net: Replace u64_stats_fetch_begin_bh to u64_stats_fetch_begin_irq 2020-11-30 19:26:49 +03:00
syncookies.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
sysctl_net_ipv6.c net: add a sysctl to reflect the fwmark on replies 2014-05-12 22:39:57 -07:00
tcp_ipv6.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
tunnel6.c ipv6: fix tunnel error handling 2016-10-26 23:15:24 +08:00
udp.c net: inet: Support UID-based routing in IP protocols. 2023-02-18 18:38:56 +01:00
udp_impl.h ipv6: do not clear pinet6 field 2017-12-15 22:54:52 +03:00
udplite.c ipv6: do not clear pinet6 field 2017-12-15 22:54:52 +03:00
xfrm6_input.c
xfrm6_mode_beet.c ipsec: be careful of non existing mac headers 2012-02-23 16:50:45 -05:00
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c xfrm: allow to avoid copying DSCP during encapsulation 2020-11-30 19:39:33 +03:00
xfrm6_output.c ipv6: Fix IPsec pre-encap fragmentation check 2016-04-27 18:55:20 +08:00
xfrm6_policy.c xfrm6: release dev before returning error 2013-05-19 10:54:47 -07:00
xfrm6_state.c
xfrm6_tunnel.c