mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()
authorqize wang <wangqize888888888@gmail.com>
Fri, 29 Nov 2019 10:10:54 +0000 (18:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 08:07:47 +0000 (09:07 +0100)
commitcb87b895f1468df7a163a6c665bf106a4d26f8c1
treed5f01cb5528f37c176a383f3c47147f07068e523
parenta2ecb2d17b707058755a9a8c4677c2a724e24535
mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()

commit 1e58252e334dc3f3756f424a157d1b7484464c40 upstream.

mwifiex_process_tdls_action_frame() without checking
the incoming tdls infomation element's vality before use it,
this may cause multi heap buffer overflows.

Fix them by putting vality check before use it.

IE is TLV struct, but ht_cap and  ht_oper aren’t TLV struct.
the origin marvell driver code is wrong:

memcpy(&sta_ptr->tdls_cap.ht_oper, pos,....
memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos,...

Fix the bug by changing pos(the address of IE) to
pos+2 ( the address of IE value ).

Signed-off-by: qize wang <wangqize888888888@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/marvell/mwifiex/tdls.c