]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 2 Dec 2019 14:51:58 +0000 (16:51 +0200)
commitb29e9fc0ddda737d671a14471ef54ea5e49fc5c8
tree8b76f404aa02e7d73a4a0400db55ad69e988d47b
parente04d84c130ad58e2f745f25ba6ea5c9fb00efd4b
mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()

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>
drivers/net/wireless/marvell/mwifiex/tdls.c