Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: socket: return changed ifreq from SIOCDEVPRIVATE

Some drivers that use SIOCDEVPRIVATE ioctl commands modify
the ifreq structure and expect it to be passed back to user
space, which has never really happened for compat mode
because the calling these drivers through ndo_do_ioctl
requires overwriting the ifr_data pointer.

Now that all drivers are converted to ndo_siocdevprivate,
change it to handle this correctly in both compat and
native mode.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arnd Bergmann and committed by
David S. Miller
88fc023f ad7eab2a

+2 -4
+1 -3
net/core/dev_ioctl.c
··· 286 286 return -ENODEV; 287 287 } 288 288 289 - /* fall back to do_ioctl for drivers not yet converted */ 290 - ifr->ifr_data = data; 291 - return dev_do_ioctl(dev, ifr, cmd); 289 + return -EOPNOTSUPP; 292 290 } 293 291 294 292 static int dev_siocwandev(struct net_device *dev, struct if_settings *ifs)
+1 -1
net/socket.c
··· 3234 3234 struct net *net = sock_net(sk); 3235 3235 3236 3236 if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) 3237 - return compat_ifr_data_ioctl(net, cmd, argp); 3237 + return sock_ioctl(file, cmd, (unsigned long)argp); 3238 3238 3239 3239 switch (cmd) { 3240 3240 case SIOCSIFBR: