* [PATCH] d80211: Fix skb panic during passive scan
@ 2007-02-18 13:16 Ivo van Doorn
2007-02-19 20:24 ` Jiri Benc
0 siblings, 1 reply; 2+ messages in thread
From: Ivo van Doorn @ 2007-02-18 13:16 UTC (permalink / raw)
To: linux-wireless; +Cc: Jiri Benc, John Linville
Only add the extra_tx_headroom to the len when allocating
the sk_buff. This will prevent using an invalid length for skb_put
which would cause a skb panic inside the driver.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/net/d80211/ieee80211_scan.c b/net/d80211/ieee80211_scan.c
index 263de0d..1d77155 100644
--- a/net/d80211/ieee80211_scan.c
+++ b/net/d80211/ieee80211_scan.c
@@ -280,7 +280,7 @@ void ieee80211_init_scan(struct ieee80211_local *local)
{
struct ieee80211_hdr hdr;
u16 fc;
- int len = 10 + local->hw.extra_tx_headroom;
+ int len = 10;
struct rate_control_extra extra;
/* Only initialize passive scanning if the hardware supports it */
@@ -303,7 +303,8 @@ void ieee80211_init_scan(struct ieee80211_local *local)
/* Create a CTS from for broadcasting before
* the low level changes channels */
- local->scan.skb = alloc_skb(len, GFP_KERNEL);
+ local->scan.skb = alloc_skb(len + local->hw.extra_tx_headroom,
+ GFP_KERNEL);
if (!local->scan.skb) {
printk(KERN_WARNING "%s: Failed to allocate CTS packet for "
"passive scan\n", local->mdev->name);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] d80211: Fix skb panic during passive scan
2007-02-18 13:16 [PATCH] d80211: Fix skb panic during passive scan Ivo van Doorn
@ 2007-02-19 20:24 ` Jiri Benc
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Benc @ 2007-02-19 20:24 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: linux-wireless, John Linville
On Sun, 18 Feb 2007 14:16:24 +0100, Ivo van Doorn wrote:
> Only add the extra_tx_headroom to the len when allocating
> the sk_buff. This will prevent using an invalid length for skb_put
> which would cause a skb panic inside the driver.
Applied, thanks for the patch!
Jiri
--
Jiri Benc
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-19 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-18 13:16 [PATCH] d80211: Fix skb panic during passive scan Ivo van Doorn
2007-02-19 20:24 ` Jiri Benc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).