[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007261555.lblL7IwY%lkp@intel.com>
Date: Sun, 26 Jul 2020 15:04:02 +0800
From: kernel test robot <lkp@...el.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: net/ipv6/ip6mr.c:1772:21: sparse: sparse: incorrect type in argument
1 (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 04300d66f0a06d572d9f2ad6768c38cabde22179
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 5 weeks ago
config: sh-randconfig-s031-20200726 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-93-g4c6cbe55-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
net/ipv6/ip6mr.c:1721:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/ipv6/ip6mr.c:1721:21: sparse: expected int const *__gu_addr
net/ipv6/ip6mr.c:1721:21: sparse: got int [noderef] __user *
net/ipv6/ip6mr.c:1721:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/ipv6/ip6mr.c:1721:21: sparse: expected void const volatile [noderef] __user *
net/ipv6/ip6mr.c:1721:21: sparse: got int const *__gu_addr
net/ipv6/ip6mr.c:1738:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/ipv6/ip6mr.c:1738:21: sparse: expected int const *__gu_addr
net/ipv6/ip6mr.c:1738:21: sparse: got int [noderef] __user *
net/ipv6/ip6mr.c:1738:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/ipv6/ip6mr.c:1738:21: sparse: expected void const volatile [noderef] __user *
net/ipv6/ip6mr.c:1738:21: sparse: got int const *__gu_addr
net/ipv6/ip6mr.c:1751:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/ipv6/ip6mr.c:1751:21: sparse: expected int const *__gu_addr
net/ipv6/ip6mr.c:1751:21: sparse: got int [noderef] __user *
net/ipv6/ip6mr.c:1751:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/ipv6/ip6mr.c:1751:21: sparse: expected void const volatile [noderef] __user *
net/ipv6/ip6mr.c:1751:21: sparse: got int const *__gu_addr
net/ipv6/ip6mr.c:1772:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
net/ipv6/ip6mr.c:1772:21: sparse: expected unsigned int const *__gu_addr
net/ipv6/ip6mr.c:1772:21: sparse: got unsigned int [noderef] [usertype] __user *
>> net/ipv6/ip6mr.c:1772:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
net/ipv6/ip6mr.c:1772:21: sparse: expected void const volatile [noderef] __user *
net/ipv6/ip6mr.c:1772:21: sparse: got unsigned int const *__gu_addr
net/ipv6/ip6mr.c:1836:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ip6mr.c:1836:13: sparse: expected int const *__gu_addr
net/ipv6/ip6mr.c:1836:13: sparse: got int [noderef] __user *optlen
net/ipv6/ip6mr.c:1836:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/ipv6/ip6mr.c:1836:13: sparse: expected void const volatile [noderef] __user *
net/ipv6/ip6mr.c:1836:13: sparse: got int const *__gu_addr
net/ipv6/ip6mr.c:405:13: sparse: sparse: context imbalance in 'ip6mr_vif_seq_start' - different lock contexts for basic block
net/ipv6/ip6mr.c: note: in included file (through include/linux/mroute6.h):
include/linux/mroute_base.h:427:31: sparse: sparse: context imbalance in 'mr_mfc_seq_stop' - unexpected unlock
--
net/netrom/af_netrom.c:309:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] __user * @@
net/netrom/af_netrom.c:309:13: sparse: expected unsigned int const *__gu_addr
net/netrom/af_netrom.c:309:13: sparse: got unsigned int [noderef] __user *
>> net/netrom/af_netrom.c:309:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
>> net/netrom/af_netrom.c:309:13: sparse: expected void const volatile [noderef] __user *
net/netrom/af_netrom.c:309:13: sparse: got unsigned int const *__gu_addr
net/netrom/af_netrom.c:359:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/netrom/af_netrom.c:359:13: sparse: expected int const *__gu_addr
net/netrom/af_netrom.c:359:13: sparse: got int [noderef] __user *optlen
>> net/netrom/af_netrom.c:359:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/netrom/af_netrom.c:359:13: sparse: expected void const volatile [noderef] __user *
net/netrom/af_netrom.c:359:13: sparse: got int const *__gu_addr
--
net/rose/af_rose.c:380:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/rose/af_rose.c:380:13: sparse: expected int const *__gu_addr
net/rose/af_rose.c:380:13: sparse: got int [noderef] __user *
>> net/rose/af_rose.c:380:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
>> net/rose/af_rose.c:380:13: sparse: expected void const volatile [noderef] __user *
net/rose/af_rose.c:380:13: sparse: got int const *__gu_addr
net/rose/af_rose.c:438:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/rose/af_rose.c:438:13: sparse: expected int const *__gu_addr
net/rose/af_rose.c:438:13: sparse: got int [noderef] __user *optlen
net/rose/af_rose.c:438:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/rose/af_rose.c:438:13: sparse: expected void const volatile [noderef] __user *
net/rose/af_rose.c:438:13: sparse: got int const *__gu_addr
--
net/ax25/af_ax25.c:546:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] __user * @@
net/ax25/af_ax25.c:546:13: sparse: expected unsigned int const *__gu_addr
net/ax25/af_ax25.c:546:13: sparse: got unsigned int [noderef] __user *
>> net/ax25/af_ax25.c:546:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
>> net/ax25/af_ax25.c:546:13: sparse: expected void const volatile [noderef] __user *
net/ax25/af_ax25.c:546:13: sparse: got unsigned int const *__gu_addr
net/ax25/af_ax25.c:695:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/ax25/af_ax25.c:695:13: sparse: expected int const *__gu_addr
net/ax25/af_ax25.c:695:13: sparse: got int [noderef] __user *optlen
>> net/ax25/af_ax25.c:695:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/ax25/af_ax25.c:695:13: sparse: expected void const volatile [noderef] __user *
net/ax25/af_ax25.c:695:13: sparse: got int const *__gu_addr
net/ax25/af_ax25.c:1736:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected long const *__gu_addr @@ got long [noderef] __user * @@
net/ax25/af_ax25.c:1736:21: sparse: expected long const *__gu_addr
net/ax25/af_ax25.c:1736:21: sparse: got long [noderef] __user *
>> net/ax25/af_ax25.c:1736:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got long const *__gu_addr @@
net/ax25/af_ax25.c:1736:21: sparse: expected void const volatile [noderef] __user *
net/ax25/af_ax25.c:1736:21: sparse: got long const *__gu_addr
--
drivers/watchdog/watchdog_dev.c:680:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const *__gu_addr @@ got char const [noderef] __user * @@
drivers/watchdog/watchdog_dev.c:680:21: sparse: expected char const *__gu_addr
drivers/watchdog/watchdog_dev.c:680:21: sparse: got char const [noderef] __user *
>> drivers/watchdog/watchdog_dev.c:680:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got char const *__gu_addr @@
>> drivers/watchdog/watchdog_dev.c:680:21: sparse: expected void const volatile [noderef] __user *
drivers/watchdog/watchdog_dev.c:680:21: sparse: got char const *__gu_addr
drivers/watchdog/watchdog_dev.c:746:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *p @@
drivers/watchdog/watchdog_dev.c:746:21: sparse: expected int const *__gu_addr
drivers/watchdog/watchdog_dev.c:746:21: sparse: got int [noderef] __user *p
>> drivers/watchdog/watchdog_dev.c:746:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
drivers/watchdog/watchdog_dev.c:746:21: sparse: expected void const volatile [noderef] __user *
drivers/watchdog/watchdog_dev.c:746:21: sparse: got int const *__gu_addr
drivers/watchdog/watchdog_dev.c:766:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *p @@
drivers/watchdog/watchdog_dev.c:766:21: sparse: expected int const *__gu_addr
drivers/watchdog/watchdog_dev.c:766:21: sparse: got int [noderef] __user *p
drivers/watchdog/watchdog_dev.c:766:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
drivers/watchdog/watchdog_dev.c:766:21: sparse: expected void const volatile [noderef] __user *
drivers/watchdog/watchdog_dev.c:766:21: sparse: got int const *__gu_addr
drivers/watchdog/watchdog_dev.c:795:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *p @@
drivers/watchdog/watchdog_dev.c:795:21: sparse: expected int const *__gu_addr
drivers/watchdog/watchdog_dev.c:795:21: sparse: got int [noderef] __user *p
drivers/watchdog/watchdog_dev.c:795:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
drivers/watchdog/watchdog_dev.c:795:21: sparse: expected void const volatile [noderef] __user *
drivers/watchdog/watchdog_dev.c:795:21: sparse: got int const *__gu_addr
--
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char [noderef] __user *__pu_addr @@ got char *buf @@
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: expected char [noderef] __user *__pu_addr
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: got char *buf
>> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got char const *__gu_addr @@
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: expected void const volatile [noderef] __user *
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: got char const *__gu_addr
--
drivers/fsi/fsi-scom.c:497:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
drivers/fsi/fsi-scom.c:497:13: sparse: expected unsigned int const *__gu_addr
drivers/fsi/fsi-scom.c:497:13: sparse: got unsigned int [noderef] [usertype] __user *
>> drivers/fsi/fsi-scom.c:497:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
>> drivers/fsi/fsi-scom.c:497:13: sparse: expected void const volatile [noderef] __user *
drivers/fsi/fsi-scom.c:497:13: sparse: got unsigned int const *__gu_addr
vim +1772 net/ipv6/ip6mr.c
6bd521433942d8 Patrick McHardy 2010-05-11 1624
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1625 /*
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1626 * Socket options and virtual interface manipulation. The whole
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1627 * virtual interface system is a complete heap, but unfortunately
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1628 * that's how BSD mrouted happens to think. Maybe one day with a proper
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1629 * MOSPF/PIM router set up we can clean this up.
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1630 */
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1631
b7058842c940ad David S. Miller 2009-09-30 1632 int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsigned int optlen)
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1633 {
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1634 int ret, parent = 0;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1635 struct mif6ctl vif;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1636 struct mf6cctl mfc;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1637 mifi_t mifi;
8229efdaef1e79 Benjamin Thery 2008-12-10 1638 struct net *net = sock_net(sk);
b70432f7319eb7 Yuval Mintz 2018-02-28 1639 struct mr_table *mrt;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1640
99253eb750fda6 Xin Long 2017-02-24 1641 if (sk->sk_type != SOCK_RAW ||
99253eb750fda6 Xin Long 2017-02-24 1642 inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
99253eb750fda6 Xin Long 2017-02-24 1643 return -EOPNOTSUPP;
99253eb750fda6 Xin Long 2017-02-24 1644
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1645 mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
63159f29be1df7 Ian Morris 2015-03-29 1646 if (!mrt)
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1647 return -ENOENT;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1648
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1649 if (optname != MRT6_INIT) {
b70432f7319eb7 Yuval Mintz 2018-02-28 1650 if (sk != rcu_access_pointer(mrt->mroute_sk) &&
8571ab479a6e1e Yuval Mintz 2018-02-28 1651 !ns_capable(net->user_ns, CAP_NET_ADMIN))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1652 return -EACCES;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1653 }
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1654
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1655 switch (optname) {
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1656 case MRT6_INIT:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1657 if (optlen < sizeof(int))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1658 return -EINVAL;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1659
6bd521433942d8 Patrick McHardy 2010-05-11 1660 return ip6mr_sk_init(mrt, sk);
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1661
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1662 case MRT6_DONE:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1663 return ip6mr_sk_done(sk);
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1664
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1665 case MRT6_ADD_MIF:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1666 if (optlen < sizeof(vif))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1667 return -EINVAL;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1668 if (copy_from_user(&vif, optval, sizeof(vif)))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1669 return -EFAULT;
6ac7eb0868ccc9 Rami Rosen 2008-04-10 1670 if (vif.mif6c_mifi >= MAXMIFS)
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1671 return -ENFILE;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1672 rtnl_lock();
8571ab479a6e1e Yuval Mintz 2018-02-28 1673 ret = mif6_add(net, mrt, &vif,
b70432f7319eb7 Yuval Mintz 2018-02-28 1674 sk == rtnl_dereference(mrt->mroute_sk));
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1675 rtnl_unlock();
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1676 return ret;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1677
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1678 case MRT6_DEL_MIF:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1679 if (optlen < sizeof(mifi_t))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1680 return -EINVAL;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1681 if (copy_from_user(&mifi, optval, sizeof(mifi_t)))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1682 return -EFAULT;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1683 rtnl_lock();
723b929ca0f79c Nikolay Aleksandrov 2017-04-21 1684 ret = mif6_delete(mrt, mifi, 0, NULL);
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1685 rtnl_unlock();
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1686 return ret;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1687
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1688 /*
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1689 * Manipulate the forwarding caches. These live
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1690 * in a sort of kernel/user symbiosis.
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1691 */
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1692 case MRT6_ADD_MFC:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1693 case MRT6_DEL_MFC:
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1694 parent = -1;
a8eceea84a3a35 Joe Perches 2020-03-12 1695 fallthrough;
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1696 case MRT6_ADD_MFC_PROXY:
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1697 case MRT6_DEL_MFC_PROXY:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1698 if (optlen < sizeof(mfc))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1699 return -EINVAL;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1700 if (copy_from_user(&mfc, optval, sizeof(mfc)))
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1701 return -EFAULT;
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1702 if (parent == 0)
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1703 parent = mfc.mf6cc_parent;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1704 rtnl_lock();
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1705 if (optname == MRT6_DEL_MFC || optname == MRT6_DEL_MFC_PROXY)
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1706 ret = ip6mr_mfc_delete(mrt, &mfc, parent);
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1707 else
660b26dc1a8aeb Nicolas Dichtel 2013-01-21 1708 ret = ip6mr_mfc_add(net, mrt, &mfc,
8571ab479a6e1e Yuval Mintz 2018-02-28 1709 sk ==
b70432f7319eb7 Yuval Mintz 2018-02-28 1710 rtnl_dereference(mrt->mroute_sk),
8571ab479a6e1e Yuval Mintz 2018-02-28 1711 parent);
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1712 rtnl_unlock();
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1713 return ret;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1714
ca8d4794f669e7 Callum Sinclair 2019-02-18 1715 case MRT6_FLUSH:
ca8d4794f669e7 Callum Sinclair 2019-02-18 1716 {
ca8d4794f669e7 Callum Sinclair 2019-02-18 1717 int flags;
ca8d4794f669e7 Callum Sinclair 2019-02-18 1718
ca8d4794f669e7 Callum Sinclair 2019-02-18 1719 if (optlen != sizeof(flags))
ca8d4794f669e7 Callum Sinclair 2019-02-18 1720 return -EINVAL;
ca8d4794f669e7 Callum Sinclair 2019-02-18 1721 if (get_user(flags, (int __user *)optval))
ca8d4794f669e7 Callum Sinclair 2019-02-18 1722 return -EFAULT;
ca8d4794f669e7 Callum Sinclair 2019-02-18 1723 rtnl_lock();
ca8d4794f669e7 Callum Sinclair 2019-02-18 1724 mroute_clean_tables(mrt, flags);
ca8d4794f669e7 Callum Sinclair 2019-02-18 1725 rtnl_unlock();
ca8d4794f669e7 Callum Sinclair 2019-02-18 1726 return 0;
ca8d4794f669e7 Callum Sinclair 2019-02-18 1727 }
ca8d4794f669e7 Callum Sinclair 2019-02-18 1728
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1729 /*
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1730 * Control PIM assert (to activate pim will activate assert)
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1731 */
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1732 case MRT6_ASSERT:
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1733 {
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1734 int v;
03f52a0a554210 Joe Perches 2012-11-25 1735
03f52a0a554210 Joe Perches 2012-11-25 1736 if (optlen != sizeof(v))
03f52a0a554210 Joe Perches 2012-11-25 1737 return -EINVAL;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1738 if (get_user(v, (int __user *)optval))
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1739 return -EFAULT;
53d6841d225b93 Joe Perches 2012-11-25 1740 mrt->mroute_do_assert = v;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1741 return 0;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1742 }
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1743
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1744 #ifdef CONFIG_IPV6_PIMSM_V2
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1745 case MRT6_PIM:
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1746 {
a9f83bf3858672 YOSHIFUJI Hideaki 2008-04-10 1747 int v;
03f52a0a554210 Joe Perches 2012-11-25 1748
03f52a0a554210 Joe Perches 2012-11-25 1749 if (optlen != sizeof(v))
03f52a0a554210 Joe Perches 2012-11-25 1750 return -EINVAL;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 @1751 if (get_user(v, (int __user *)optval))
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1752 return -EFAULT;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1753 v = !!v;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1754 rtnl_lock();
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1755 ret = 0;
6bd521433942d8 Patrick McHardy 2010-05-11 1756 if (v != mrt->mroute_do_pim) {
6bd521433942d8 Patrick McHardy 2010-05-11 1757 mrt->mroute_do_pim = v;
6bd521433942d8 Patrick McHardy 2010-05-11 1758 mrt->mroute_do_assert = v;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1759 }
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1760 rtnl_unlock();
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1761 return ret;
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1762 }
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1763
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1764 #endif
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1765 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1766 case MRT6_TABLE:
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1767 {
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1768 u32 v;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1769
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1770 if (optlen != sizeof(u32))
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1771 return -EINVAL;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 @1772 if (get_user(v, (u32 __user *)optval))
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1773 return -EFAULT;
75356a8143426a Dan Carpenter 2013-01-23 1774 /* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
75356a8143426a Dan Carpenter 2013-01-23 1775 if (v != RT_TABLE_DEFAULT && v >= 100000000)
75356a8143426a Dan Carpenter 2013-01-23 1776 return -EINVAL;
b70432f7319eb7 Yuval Mintz 2018-02-28 1777 if (sk == rcu_access_pointer(mrt->mroute_sk))
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1778 return -EBUSY;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1779
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1780 rtnl_lock();
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1781 ret = 0;
e783bb00ad86d9 Sabrina Dubroca 2018-06-05 1782 mrt = ip6mr_new_table(net, v);
e783bb00ad86d9 Sabrina Dubroca 2018-06-05 1783 if (IS_ERR(mrt))
e783bb00ad86d9 Sabrina Dubroca 2018-06-05 1784 ret = PTR_ERR(mrt);
848235edb5c93e Sabrina Dubroca 2018-06-05 1785 else
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1786 raw6_sk(sk)->ip6mr_table = v;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1787 rtnl_unlock();
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1788 return ret;
d1db275dd3f6e4 Patrick McHardy 2010-05-11 1789 }
14fb64e1f449ef YOSHIFUJI Hideaki 2008-04-03 1790 #endif
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1791 /*
7d120c55df02a2 Rami Rosen 2008-04-23 1792 * Spurious command, or MRT6_VERSION which you cannot
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1793 * set.
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1794 */
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1795 default:
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1796 return -ENOPROTOOPT;
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1797 }
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1798 }
7bc570c8b4f75d YOSHIFUJI Hideaki 2008-04-03 1799
:::::: The code at line 1772 was first introduced by commit
:::::: d1db275dd3f6e4182c4c4b4a1ac6287925d60569 ipv6: ip6mr: support multiple tables
:::::: TO: Patrick McHardy <kaber@...sh.net>
:::::: CC: Patrick McHardy <kaber@...sh.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (25267 bytes)
Powered by blists - more mailing lists