[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202305200047.UqVIW4qo-lkp@intel.com>
Date: Sat, 20 May 2023 00:54:44 +0800
From: kernel test robot <lkp@...el.com>
To: Breno Leitao <leitao@...ian.org>, axboe@...nel.dk,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, willemdebruijn.kernel@...il.com,
courmisch@...il.com, nhorman@...driver.com
Cc: oe-kbuild-all@...ts.linux.dev, asml.silence@...il.com,
alex.aring@...il.com, dccp@...r.kernel.org, mptcp@...ts.linux.dev,
linux-kernel@...r.kernel.org, matthieu.baerts@...sares.net,
marcelo.leitner@...il.com, linux-wpan@...r.kernel.org,
linux-sctp@...r.kernel.org, leit@...com, David.Laight@...lab.com,
dsahern@...nel.org
Subject: Re: [PATCH 1/1] net: ioctl: Use kernel memory on protocol ioctl
callbacks
Hi Breno,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mptcp/export]
[also build test WARNING on mptcp/export-net net-next/main net/main linus/master v6.4-rc2 next-20230519]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Breno-Leitao/net-ioctl-Use-kernel-memory-on-protocol-ioctl-callbacks/20230519-223824
base: https://github.com/multipath-tcp/mptcp_net-next.git export
patch link: https://lore.kernel.org/r/20230519135821.922326-2-leitao%40debian.org
patch subject: [PATCH 1/1] net: ioctl: Use kernel memory on protocol ioctl callbacks
config: m68k-allyesconfig
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/95a4f4f84bf68692f5b42921c9f6067c0986aed8
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Breno-Leitao/net-ioctl-Use-kernel-memory-on-protocol-ioctl-callbacks/20230519-223824
git checkout 95a4f4f84bf68692f5b42921c9f6067c0986aed8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash net/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305200047.UqVIW4qo-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> net/core/sock.c:4114:5: warning: no previous prototype for 'sock_skproto_ioctl_in' [-Wmissing-prototypes]
4114 | int sock_skproto_ioctl_in(struct sock *sk, unsigned int cmd,
| ^~~~~~~~~~~~~~~~~~~~~
>> net/core/sock.c:4126:5: warning: no previous prototype for 'sock_skproto_ioctl_inout' [-Wmissing-prototypes]
4126 | int sock_skproto_ioctl_inout(struct sock *sk, unsigned int cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> net/core/sock.c:4157:5: warning: no previous prototype for 'sock_skproto_ioctl_out' [-Wmissing-prototypes]
4157 | int sock_skproto_ioctl_out(struct sock *sk, unsigned int cmd,
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/sock_skproto_ioctl_in +4114 net/core/sock.c
4112
4113 /* Copy 'size' bytes from userspace and do not copy anything back */
> 4114 int sock_skproto_ioctl_in(struct sock *sk, unsigned int cmd,
4115 void __user *arg)
4116 {
4117 int karg;
4118
4119 if (get_user(karg, (u32 __user *)arg))
4120 return -EFAULT;
4121
4122 return sk->sk_prot->ioctl(sk, cmd, &karg);
4123 }
4124
4125 /* Copy 'size' bytes from userspace and return `size` back to userspace */
> 4126 int sock_skproto_ioctl_inout(struct sock *sk, unsigned int cmd,
4127 void __user *arg, size_t size)
4128 {
4129 void *ptr;
4130 int ret;
4131
4132 ptr = kmalloc(size, GFP_KERNEL);
4133 if (!ptr)
4134 return -ENOMEM;
4135
4136 if (copy_from_user(ptr, arg, size)) {
4137 ret = -EFAULT;
4138 goto out;
4139 }
4140
4141 ret = sk->sk_prot->ioctl(sk, cmd, ptr);
4142 if (ret)
4143 goto out;
4144
4145 if (copy_to_user(arg, ptr, size))
4146 ret = -EFAULT;
4147
4148 out:
4149 kfree(ptr);
4150 return ret;
4151 }
4152
4153 /* This is the most common ioctl prep function, where the result (4 bytes) is
4154 * copied back to userspace if the ioctl() returns successfully. No input is
4155 * copied from userspace as input argument.
4156 */
> 4157 int sock_skproto_ioctl_out(struct sock *sk, unsigned int cmd,
4158 void __user *arg)
4159 {
4160 int ret, karg = 0;
4161
4162 ret = sk->sk_prot->ioctl(sk, cmd, &karg);
4163 if (ret)
4164 return ret;
4165
4166 return put_user(karg, (int __user *)arg);
4167 }
4168
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
View attachment "config" of type "text/plain" (289988 bytes)
Powered by blists - more mailing lists