wifi: wilc1000: validate number of channels
authorPhil Turnbull <philipturnbull@github.com>
Wed, 23 Nov 2022 15:35:43 +0000 (10:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:11 +0000 (17:41 +0100)
commit7aed1dd5d221dabe3fe258f13ecf5fc7df393cbb
treee61e4abc975741ed2462420d81b410efc1544c32
parente9de501cf70d2b508b2793ed3e7d5d5ceabd7a74
wifi: wilc1000: validate number of channels

commit 0cdfa9e6f0915e3d243e2393bfa8a22e12d553b0 upstream.

There is no validation of 'e->no_of_channels' which can trigger an
out-of-bounds write in the following 'memset' call. Validate that the
number of channels does not extends beyond the size of the channel list
element.

Signed-off-by: Phil Turnbull <philipturnbull@github.com>
Tested-by: Ajay Kathat <ajay.kathat@microchip.com>
Acked-by: Ajay Kathat <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221123153543.8568-5-philipturnbull@github.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/microchip/wilc1000/cfg80211.c