diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-07-27 15:45:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-27 20:11:44 +0100 |
commit | a554bf96b49db4c208e305ae92546422e9489380 (patch) | |
tree | 6fce988f6f02fc3df0e3abb197f610ca2a1bfbec /net/ethtool | |
parent | 8fb75b79cd98944c118861ff3194caf731f5ec5a (diff) | |
download | linux-a554bf96b49db4c208e305ae92546422e9489380.tar.bz2 |
dev_ioctl: pass SIOCDEVPRIVATE data separately
The compat handlers for SIOCDEVPRIVATE are incorrect for any driver that
passes data as part of struct ifreq rather than as an ifr_data pointer, or
that passes data back this way, since the compat_ifr_data_ioctl() helper
overwrites the ifr_data pointer and does not copy anything back out.
Since all drivers using devprivate commands are now converted to the
new .ndo_siocdevprivate callback, fix this by adding the missing piece
and passing the pointer separately the whole way.
This further unifies the native and compat logic for socket ioctls,
as the new code now passes the correct pointer as well as the correct
data for both native and compat ioctls.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool')
-rw-r--r-- | net/ethtool/ioctl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index af011534bcb2..b0fa2b00ad43 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -2685,10 +2685,9 @@ static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr) /* The main entry point in this file. Called from net/core/dev_ioctl.c */ -int dev_ethtool(struct net *net, struct ifreq *ifr) +int dev_ethtool(struct net *net, struct ifreq *ifr, void __user *useraddr) { struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name); - void __user *useraddr = ifr->ifr_data; u32 ethcmd, sub_cmd; int rc; netdev_features_t old_features; |