Files
linux/net
Xin Long 90e3225d28 ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
[ Upstream commit 99253eb750 ]

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>
2023-05-15 14:08:35 +09:00
..
2015-03-02 16:43:41 -05:00
2023-05-15 12:38:05 +09:00
2023-05-15 13:49:35 +09:00
2016-10-20 11:23:08 -04:00
2023-05-15 12:05:35 +09:00
2018-05-16 11:39:34 +02:00
2023-05-15 11:55:21 +09:00
2023-05-15 10:49:15 +09:00
2016-08-17 19:36:23 -04:00
2023-05-15 09:14:58 +09:00