mwifiex: potential corruption in mwifiex_update_uap_custom_ie()
Subsystems (2)
PATCH 1/1 mwifiex: potential corruption in mwifiex_update_uap_custom_ie()
ap_custom_ie is a struct mwifiex_ie_list which is quite different and also larger than struct mwifiex_ie. It's a difference between 4196 bytes and 262.
Signed-off-by Dan Carpenter <[email protected]>
---
This is a static checker fix and I don't have the hardware to test it. Please review it carefully.
drivers/net/wireless/mwifiex/ie.c +1 -1
@@ -160,7 +160,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv,u16 len;int ret; - ap_custom_ie =kzalloc (sizeof (struct mwifiex_ie ),GFP_KERNEL ); + ap_custom_ie =kzalloc (sizeof (*ap_custom_ie),GFP_KERNEL );if (!ap_custom_ie)return -ENOMEM ;
Hi Dan,
Thanks for the patch.
Quoted 5 lines
ap_custom_ieis a structmwifiex_ie_listwhich is quite different and also larger than structmwifiex_ie. It's a difference between 4196 bytes and 262.Signed-off-by Dan Carpenter <[email protected]>
Tested-by Stone Piao <[email protected]>
Acked-by Bing Zhao <[email protected]>
Thanks,
Bing
Quoted 17 lines
---
This is a static checker fix and I don't have the hardware to test it. Please review it carefully.drivers/net/wireless/mwifiex/ie.c +1
-1@@ -160,7 +160,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv,u16 len;int ret; - ap_custom_ie =kzalloc (sizeof (struct mwifiex_ie ),GFP_KERNEL ); + ap_custom_ie =kzalloc (sizeof (*ap_custom_ie),GFP_KERNEL );if (!ap_custom_ie)return -ENOMEM ;