[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090226205921.M20262@bobcopeland.com>
Date: Thu, 26 Feb 2009 16:05:06 -0500
From: "Bob Copeland" <me@...copeland.com>
To: Jiri Slaby <jirislaby@...il.com>
Cc: Sitsofe Wheeler <sitsofe@...oo.com>,
Nick Kossifidis <mickflemm@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
ath5k-devel@...ema.h4ckr.net,
"Luis R. Rodriguez" <lrodriguez@...eros.com>
Subject: Re: [TIP] BUG kmalloc-4096: Poison overwritten (ath5k_rx_skb_alloc)
On Thu, 26 Feb 2009 21:53:08 +0100, Jiri Slaby wrote
> On 26.2.2009 02:06, Bob Copeland wrote:
> > --- 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;
>
> Hmm, rather than the caller, ath5k_rx_skb_alloc is wrong here in my
> eyes. It shouldn't touch the second parameter unless it knows it won't
> fail anymore.
Sure, the temporary could go there instead. It's a consequence of my
making ath5k_rx_skb_alloc() as much as possible a straight code move
from the original, which IIRC would also clobber bf->skbaddr on the
error path.
--
Bob Copeland %% www.bobcopeland.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists