tree:
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
arm-kill-set_fs-6
head: 2f6df142351693125bcb0a58d7986d3756f6723d
commit: 9ae4fdf85acf0b112239c841b7027c52f4c9f544 [22/41] dev_ioctl: split out SIOC?IFMAP
ioctls
config: sh-rsk7264_defconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.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
git checkout 9ae4fdf85acf0b112239c841b7027c52f4c9f544
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
cc1: warning: arch/sh/include/mach-rsk: No such file or directory
[-Wmissing-include-dirs]
cc1: warning: arch/sh/include/mach-rsk: No such file or directory
[-Wmissing-include-dirs]
net/core/dev_ioctl.c: In function 'dev_ifmap':
> net/core/dev_ioctl.c:106:22: error: storage size of
'cifmap' isn't known
106 | struct compat_ifmap cifmap;
| ^~~~~~
net/core/dev_ioctl.c:106:22: warning: unused variable 'cifmap'
[-Wunused-variable]
#
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commi...
git remote add arnd-playground
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground arm-kill-set_fs-6
git checkout 9ae4fdf85acf0b112239c841b7027c52f4c9f544
vim +106 net/core/dev_ioctl.c
100
101 int dev_ifmap(struct net *net, struct ifreq __user *ifr, unsigned int cmd)
102 {
103 struct net_device *dev;
104 char ifname[IFNAMSIZ];
105 char *colon;
106 struct compat_ifmap cifmap;
107 struct ifmap ifmap;
108 int ret;
109
110 if (copy_from_user(ifname, ifr->ifr_name, sizeof(ifname)))
111 return -EFAULT;
112 ifname[IFNAMSIZ-1] = 0;
113 colon = strchr(ifname, ':');
114 if (colon)
115 *colon = 0;
116 dev_load(net, ifname);
117
118 switch (cmd) {
119 case SIOCGIFMAP:
120 rcu_read_lock();
121 dev = dev_get_by_name_rcu(net, ifname);
122 if (!dev) {
123 rcu_read_unlock();
124 return -ENODEV;
125 }
126
127 if (in_compat_syscall()) {
128 cifmap.mem_start = dev->mem_start;
129 cifmap.mem_end = dev->mem_end;
130 cifmap.base_addr = dev->base_addr;
131 cifmap.irq = dev->irq;
132 cifmap.dma = dev->dma;
133 cifmap.port = dev->if_port;
134 rcu_read_unlock();
135
136 ret = copy_to_user(&ifr->ifr_data,
137 &cifmap, sizeof(cifmap));
138 } else {
139 ifmap.mem_start = dev->mem_start;
140 ifmap.mem_end = dev->mem_end;
141 ifmap.base_addr = dev->base_addr;
142 ifmap.irq = dev->irq;
143 ifmap.dma = dev->dma;
144 ifmap.port = dev->if_port;
145 rcu_read_unlock();
146
147 ret = copy_to_user(&ifr->ifr_data,
148 &ifmap, sizeof(ifmap));
149 }
150 ret = ret ? -EFAULT : 0;
151 break;
152
153 case SIOCSIFMAP:
154 if (!capable(CAP_NET_ADMIN) ||
155 !ns_capable(net->user_ns, CAP_NET_ADMIN))
156 return -EPERM;
157
158 if (in_compat_syscall()) {
159 if (copy_from_user(&cifmap, &ifr->ifr_data,
160 sizeof(cifmap)))
161 return -EFAULT;
162
163 ifmap.mem_start = cifmap.mem_start;
164 ifmap.mem_end = cifmap.mem_end;
165 ifmap.base_addr = cifmap.base_addr;
166 ifmap.irq = cifmap.irq;
167 ifmap.dma = cifmap.dma;
168 ifmap.port = cifmap.port;
169 } else {
170 if (copy_from_user(&ifmap, &ifr->ifr_data,
171 sizeof(ifmap)))
172 return -EFAULT;
173 }
174
175 rtnl_lock();
176 dev = __dev_get_by_name(net, ifname);
177 if (!dev || !netif_device_present(dev))
178 ret = -ENODEV;
179 else if (!dev->netdev_ops->ndo_set_config)
180 ret = -EOPNOTSUPP;
181 else
182 ret = dev->netdev_ops->ndo_set_config(dev, &ifmap);
183 rtnl_unlock();
184 break;
185 }
186 return ret;
187 }
188
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org