OSDN Git Service

rtlwifi: Fix potential overflow on P2P code
authorLaura Abbott <labbott@redhat.com>
Fri, 18 Oct 2019 11:43:21 +0000 (07:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 11:09:22 +0000 (12:09 +0100)
commit3da8d0e777fa8a0934a288b115373cf12d7800f8
tree71003fb150e59963b4a91468a459b533046233c7
parent1cdb53607683a4fa8625a3f3eb65e5d9f4572166
rtlwifi: Fix potential overflow on P2P code

commit 8c55dedb795be8ec0cf488f98c03a1c2176f7fb1 upstream.

Nicolas Waisman noticed that even though noa_len is checked for
a compatible length it's still possible to overrun the buffers
of p2pinfo since there's no check on the upper bound of noa_num.
Bound noa_num against P2P_MAX_NOA_NUM.

Reported-by: Nicolas Waisman <nico@semmle.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/realtek/rtlwifi/ps.c