mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
include/linux/netdevice.h net/socket.cd0efb16294
("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:
commit
29ce8f9701
14 changed files with 117 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue