[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <201809140618.ftlZeF7V%fengguang.wu@intel.com>
Date: Fri, 14 Sep 2018 06:48:57 +0800
From: kbuild test robot <lkp@...el.com>
To: Johannes Berg <johannes@...solutions.net>
Cc: kbuild-all@...org, netdev@...r.kernel.org,
Robert O'Callahan <robert@...llahan.org>,
Al Viro <viro@...iv.linux.org.uk>,
Johannes Berg <johannes.berg@...el.com>
Subject: Re: [PATCH] socket: fix struct ifreq size in compat ioctl
Hi Johannes,
I love your patch! Yet something to improve:
[auto build test ERROR on net/master]
[also build test ERROR on v4.19-rc3 next-20180913]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Johannes-Berg/socket-fix-struct-ifreq-size-in-compat-ioctl/20180914-061826
config: x86_64-randconfig-x013-201836 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
net/socket.c: In function 'sock_do_ioctl':
>> net/socket.c:972:24: error: invalid application of 'sizeof' to incomplete type 'struct compat_ifreq'
compat ? sizeof(struct compat_ifreq) :
^~~~~~
net/socket.c:978:23: error: invalid application of 'sizeof' to incomplete type 'struct compat_ifreq'
compat ? sizeof(struct compat_ifreq) :
^~~~~~
vim +972 net/socket.c
942
943 static long sock_do_ioctl(struct net *net, struct socket *sock,
944 unsigned int cmd, unsigned long arg,
945 bool compat)
946 {
947 int err;
948 void __user *argp = (void __user *)arg;
949
950 err = sock->ops->ioctl(sock, cmd, arg);
951
952 /*
953 * If this ioctl is unknown try to hand it down
954 * to the NIC driver.
955 */
956 if (err != -ENOIOCTLCMD)
957 return err;
958
959 if (cmd == SIOCGIFCONF) {
960 struct ifconf ifc;
961 if (copy_from_user(&ifc, argp, sizeof(struct ifconf)))
962 return -EFAULT;
963 rtnl_lock();
964 err = dev_ifconf(net, &ifc, sizeof(struct ifreq));
965 rtnl_unlock();
966 if (!err && copy_to_user(argp, &ifc, sizeof(struct ifconf)))
967 err = -EFAULT;
968 } else {
969 struct ifreq ifr;
970 bool need_copyout;
971 if (copy_from_user(&ifr, argp,
> 972 compat ? sizeof(struct compat_ifreq) :
973 sizeof(struct ifreq)))
974 return -EFAULT;
975 err = dev_ioctl(net, cmd, &ifr, &need_copyout);
976 if (!err && need_copyout)
977 if (copy_to_user(argp, &ifr,
978 compat ? sizeof(struct compat_ifreq) :
979 sizeof(struct ifreq)))
980 return -EFAULT;
981 }
982 return err;
983 }
984
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (28962 bytes)
Powered by blists - more mailing lists