Re: [TIP] BUG kmalloc-4096: Poison overwritten (ath5k_rx_skb_alloc)

From: Bob Copeland
Date: Fri May 15 2009 - 00:10:32 EST


On Wed, May 13, 2009 at 10:44:17PM +0100, Sitsofe Wheeler wrote:
> Could you repost the patches you wanted me to test with against the
> latest kernel?

This is too ugly to live, but I'd like to know if you can reproduce
with this patch. If it still happens, then I guess it's back to
debugging patches. I'd love to be able to replicate this here :(

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index a08bc8a..e01da34 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1143,6 +1143,13 @@ struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr)
}

static int
+ath5k_rxbuf_requeue(struct ath5k_softc *sc, struct ath5k_buf *bf)
+{
+ list_move_tail(&bf->list, &sc->rxbuf);
+ return ath5k_rxbuf_setup(sc, bf);
+}
+
+static int
ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
{
struct ath5k_hw *ah = sc->ah;
@@ -1751,7 +1758,7 @@ ath5k_tasklet_rx(unsigned long data)
goto unlock;
}
bf_last = list_entry(sc->rxbuf.prev, struct ath5k_buf, list);
- do {
+ for (;;) {
rxs.flag = 0;

bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
@@ -1904,13 +1911,18 @@ accept:
if (sc->opmode == NL80211_IFTYPE_ADHOC)
ath5k_check_ibss_tsf(sc, skb, &rxs);

- __ieee80211_rx(sc->hw, skb, &rxs);
-
bf->skb = next_skb;
bf->skbaddr = next_skb_addr;
+ if (ath5k_rxbuf_requeue(sc, bf))
+ break;
+
+ __ieee80211_rx(sc->hw, skb, &rxs);
+ continue;
next:
- list_move_tail(&bf->list, &sc->rxbuf);
- } while (ath5k_rxbuf_setup(sc, bf) == 0);
+ if (ath5k_rxbuf_requeue(sc, bf))
+ break;
+ }
+
unlock:
spin_unlock(&sc->rxbuflock);
}

--
Bob Copeland %% www.bobcopeland.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/