wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel
Prasun Maiti authored
[ Upstream commit 3d5fdff4

 ]

iwpriv app uses iw_point structure to send data to Kernel. The iw_point
structure holds a pointer. For compatibility Kernel converts the pointer
as required for WEXT IOCTLs (SIOCIWFIRST to SIOCIWLAST). Some drivers
may use iw_handler_def.private_args to populate iwpriv commands instead
of iw_handler_def.private. For those case, the IOCTLs from
SIOCIWFIRSTPRIV to SIOCIWLASTPRIV will follow the path ndo_do_ioctl().
Accordingly when the filled up iw_point structure comes from 32 bit
iwpriv to 64 bit Kernel, Kernel will not convert the pointer and sends
it to driver. So, the driver may get the invalid data.

The pointer conversion for the IOCTLs (SIOCIWFIRSTPRIV to
SIOCIWLASTPRIV), which follow the path ndo_do_ioctl(), is mandatory.
This patch adds pointer conversion from 32 bit to 64 bit and vice versa,
if the ioctl comes from 32 bit iwpriv to 64 bit Kernel.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarPrasun Maiti <prasunmaiti87@gmail.com>
Signed-off-by: default avatarUjjal Roy <royujjal@gmail.com>
Tested-by: default avatarDibyajyoti Ghosh <dibyajyotig@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
e90b6fdf
Name Last commit Last update
..
6lowpan 6lowpan: nhc: add other known rfc6282 compressions
802 net: Kill dev_rebuild_header
8021q vlan: Correctly propagate promisc|allmulti flags in notifier.
9p 9p: ensure err is initialized to 0 in p9_client_read/write
appletalk appletalk: Use eth_<foo>_addr instead of memset
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
ax25 net: add validation for the socket syscall protocol argument
batman-adv batman-adv: Drop immediate orig_node free function
bluetooth bluetooth: Validate socket address length in sco_sock_bind().
bridge switchdev: Require RTNL mutex to be held when sending FDB notifications
caif unix/caif: sk_socket can disappear when state is unlocked
can can: replace timestamp as unique skb attribute
ceph libceph: use the right footer size when skipping a message
core net: Copy inner L3 and L4 headers as unaligned on GRE TEB
dcb net/dcb: Add IEEE QCN attribute
dccp tcp/dccp: fix timewait races in timer handling
decnet net: add validation for the socket syscall protocol argument
dns_resolver Merge commit 'v3.16' into next
dsa net: dsa: Do not override PHY interface if already configured
ethernet ethernet: Use eth_<foo>_addr instead of memset
hsr net/hsr: Fix NULL pointer dereference and refcnt bugs when deleting a HSR interface.
ieee802154 ieee802154: Fix sockaddr_ieee802154 implicit padding information leak.
ipv4 tcp_cubic: do not set epoch_start in the future
ipv6 ipv6: drop frames with attached skb->sk in forwarding
ipx net: Remove iocb argument from sendmsg and recvmsg
irda
iucv
key
l2tp
lapb
llc
mac80211
mac802154
mpls
netfilter
netlabel
netlink
netrom
nfc
openvswitch
packet
phonet
rds
rfkill
rose
rxrpc
sched
sctp
sunrpc
switchdev
tipc
unix
vmw_vsock
wimax
wireless
x25
xfrm
Kconfig
Makefile
compat.c
socket.c
sysctl_net.c