]> git.baikalelectronics.ru Git - kernel.git/commit
wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel
authorPrasun Maiti <prasunmaiti87@gmail.com>
Mon, 6 Jun 2016 14:34:19 +0000 (20:04 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 9 Jun 2016 07:56:11 +0000 (09:56 +0200)
commit49f1ac73b6507ec1e5b035d64e2d1b9ee325a54c
tree40bd726dc1a385da9f3c43652b12f3a3df7c9dab
parent4286d63af36efdf1377b4c1d6105ca009e2677b7
wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel

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: Prasun Maiti <prasunmaiti87@gmail.com>
Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Tested-by: Dibyajyoti Ghosh <dibyajyotig@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/wext-core.c