projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
708eb54
)
brcmsmac: avoid 512 byte stack variable
author
Tim Gardner
<
[email protected]
>
Thu, 7 Feb 2013 20:28:09 +0000
(13:28 -0700)
committer
John W. Linville
<
[email protected]
>
Fri, 8 Feb 2013 19:51:35 +0000
(14:51 -0500)
Dynamically allocate the probe response template which
avoids potential stack corruption. Observed with smatch:
drivers/net/wireless/brcm80211/brcmsmac/main.c:7412 brcms_c_bss_update_probe_resp()
warn: 'prb_resp' puts 512 bytes on stack
Cc: Brett Rudley <
[email protected]
>
Cc: Arend van Spriel <
[email protected]
>
Cc: "Franky (Zhenhui) Lin" <
[email protected]
>
Cc: Hante Meuleman <
[email protected]
>
Cc: "John W. Linville" <
[email protected]
>
Cc: Seth Forshee <
[email protected]
>
Cc: Pieter-Paul Giesberts <
[email protected]
>
Cc: Hauke Mehrtens <
[email protected]
>
Cc:
[email protected]
Cc:
[email protected]
Cc:
[email protected]
Signed-off-by: Tim Gardner <
[email protected]
>
Acked-by: Arend van Spriel <
[email protected]
>
Signed-off-by: John W. Linville <
[email protected]
>
drivers/net/wireless/brcm80211/brcmsmac/main.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/brcm80211/brcmsmac/main.c
b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 080b54da6506dc6d7a2c62b68a97f597544e2af7..0985925cd3f41a4b69f30a27263fe6fbcb9083b7 100644
(file)
--- a/
drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/
drivers/net/wireless/brcm80211/brcmsmac/main.c
@@
-7405,9
+7405,13
@@
brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
struct brcms_bss_cfg *cfg,
bool suspend)
{
- u16
prb_resp[BCN_TMPL_LEN / 2]
;
+ u16
*prb_resp
;
int len = BCN_TMPL_LEN;
+ prb_resp = kmalloc(BCN_TMPL_LEN, GFP_ATOMIC);
+ if (!prb_resp)
+ return;
+
/*
* write the probe response to hardware, or save in
* the config structure
@@
-7441,6
+7445,8
@@
brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
if (suspend)
brcms_c_enable_mac(wlc);
+
+ kfree(prb_resp);
}
void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend)