forked from Minki/linux
29c4964822
compat_ifreq_ioctl() is one of the last users of copy_in_user() and compat_alloc_user_space(), as it attempts to convert the 'struct ifreq' arguments from 32-bit to 64-bit format as used by dev_ioctl() and a couple of socket family specific interpretations. The current implementation works correctly when calling dev_ioctl(), inet_ioctl(), ieee802154_sock_ioctl(), atalk_ioctl(), qrtr_ioctl() and packet_ioctl(). The ioctl handlers for x25, netrom, rose and x25 do not interpret the arguments and only block the corresponding commands, so they do not care. For af_inet6 and af_decnet however, the compat conversion is slightly incorrect, as it will copy more data than the native handler accesses, both of them use a structure that is shorter than ifreq. Replace the copy_in_user() conversion with a pair of accessor functions to read and write the ifreq data in place with the correct length where needed, while leaving the other ones to copy the (already compatible) structures directly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
6lowpan | ||
core.c | ||
core.h | ||
header_ops.c | ||
ieee802154.h | ||
Kconfig | ||
Makefile | ||
netlink.c | ||
nl802154.c | ||
nl802154.h | ||
nl_policy.c | ||
nl-mac.c | ||
nl-phy.c | ||
rdev-ops.h | ||
socket.c | ||
sysfs.c | ||
sysfs.h | ||
trace.c | ||
trace.h |