[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [TIP] BUG kmalloc-4096: Poison overwritten (ath5k_rx_skb_alloc)
On Wed, Feb 25, 2009 at 02:01:39PM +0000, Sitsofe Wheeler wrote:
> NAS is the name of a nearby access point. This is really tough to
> reproduce but if there's anything (e.g. ftrace) I can always turn on
> that will help you track this thing down let me know. Unfortunately the
> machine is an EeePC 900 so any logging would have to be cyclic and held
> in RAM...

Hmm, I suppose there could be some error paths under memory pressure that
aren't quite right. Here's one, but I don't think it can cause any problems,
at least without error spew.

Looking over the code, perhaps there's a race with ath5k_rx_start,
namely sc->rxlink is changed out from under the rxbuflock. Still can't
immediately see a use-after-free there.


ath5k: don't overwrite bf->skbaddr unless pcu mapping fails.

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 1d77ee9..6d91335 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1140,12 +1140,14 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
struct ath5k_hw *ah = sc->ah;
struct sk_buff *skb = bf->skb;
struct ath5k_desc *ds;
+ dma_addr_t dma_addr;

if (!skb) {
- skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr);
+ skb = ath5k_rx_skb_alloc(sc, &dma_addr);
if (!skb)
return -ENOMEM;
bf->skb = skb;
+ bf->skbaddr = dma_addr;

Bob Copeland %%

 \ /
  Last update: 2009-02-26 02:09    [W:0.234 / U:0.292 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site