Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

include/linux/netdevice.h
net/socket.c

  d0efb16294 ("net: don't unconditionally copy_from_user a struct ifreq for socket ioctls")

  876f0bf9d0 ("net: socket: simplify dev_ifconf handling")
  29c4964822 ("net: socket: rework compat_ifreq_ioctl()")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2021-08-31 09:06:04 -07:00
commit 29ce8f9701
14 changed files with 117 additions and 20 deletions

View file

@ -1124,6 +1124,9 @@ static long sock_do_ioctl(struct net *net, struct socket *sock,
if (err != -ENOIOCTLCMD)
return err;
if (!is_socket_ioctl_cmd(cmd))
return -ENOTTY;
if (get_user_ifreq(&ifr, &data, argp))
return -EFAULT;
err = dev_ioctl(net, cmd, &ifr, data, &need_copyout);
@ -3218,6 +3221,8 @@ static int compat_ifr_data_ioctl(struct net *net, unsigned int cmd,
struct ifreq ifreq;
void __user *data;
if (!is_socket_ioctl_cmd(cmd))
return -ENOTTY;
if (get_user_ifreq(&ifreq, &data, u_ifreq32))
return -EFAULT;
ifreq.ifr_data = data;