wifi: wilc1000: validate length of IEEE80211_P2P_ATTR_CHANNEL_LIST attribute
stable inclusion from stable-v5.10.157 commit 5a068535c0073c8402aa0755e8ef259fb98a33c5 category: bugfix bugzilla: 188173 https://gitee.com/src-openeuler/kernel/issues/I66M3J CVE: CVE-2022-47521 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5a068535c0073c8402aa0755e8ef259fb98a33c5 -------------------------------- commit f9b62f98 upstream. Validate that the IEEE80211_P2P_ATTR_CHANNEL_LIST attribute contains enough space for a 'struct wilc_attr_oper_ch'. If the attribute is too small then it can trigger an out-of-bounds write later in the function. 'struct wilc_attr_oper_ch' is variable sized so also check 'attr_len' does not extend beyond the end of 'buf'. Signed-off-by: NPhil Turnbull <philipturnbull@github.com> Tested-by: NAjay Kathat <ajay.kathat@microchip.com> Acked-by: NAjay Kathat <ajay.kathat@microchip.com> Signed-off-by: NKalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221123153543.8568-4-philipturnbull@github.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NLiu Jian <liujian56@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Showing
想要评论请 注册 或 登录