]> git.baikalelectronics.ru Git - kernel.git/commit
dev_ioctl: pass SIOCDEVPRIVATE data separately
authorArnd Bergmann <arnd@arndb.de>
Tue, 27 Jul 2021 13:45:12 +0000 (15:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jul 2021 19:11:44 +0000 (20:11 +0100)
commit2a483fcb147a3f9475b98d9cc056d3457957b7a9
tree6fce988f6f02fc3df0e3abb197f610ca2a1bfbec
parente50f1257dc7de59c84ed90a5fe522580fa2220ac
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>
include/linux/netdevice.h
net/core/dev_ioctl.c
net/ethtool/ioctl.c
net/socket.c