From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten Date: Mon, 04 Jul 2011 15:57:02 +0200 Message-ID: <1309787822.2247.6.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> References: <20110629145135.5179fb0c.akpm@linux-foundation.org> <1309707971.2523.20.camel@edumazet-laptop> <20110704130531.37cf876e@Nokia-N900> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Alexey Zaytsev , Andrew Morton , netdev@vger.kernel.org, Gary Zambrano , bugme-daemon@bugzilla.kernel.org, "David S. Miller" , Pekka Pietikainen , Florian Schirmer , Felix Fietkau , Michael Buesch To: Michael =?ISO-8859-1?Q?B=FCsch?= Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:44976 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754081Ab1GDN5R (ORCPT ); Mon, 4 Jul 2011 09:57:17 -0400 Received: by wwe5 with SMTP id 5so5106494wwe.1 for ; Mon, 04 Jul 2011 06:57:16 -0700 (PDT) In-Reply-To: <20110704130531.37cf876e@Nokia-N900> Sender: netdev-owner@vger.kernel.org List-ID: Le lundi 04 juillet 2011 =C3=A0 13:05 +0000, Michael B=C3=BCsch a =C3=A9= crit : > On Mon, 4 Jul 2011 15:48:31 +0400 > Alexey Zaytsev wrote: > > The skb is reinserted into the ring before its data is copied, it > > seems. But this can't be the cause of my problem, as it would lead = to > > data corruption at most, not a write-after-free. >=20 > Recycling the skb does not imply that the device can reuse it immedia= tely. The device is told at the very end of the RX function (after the = loop) that it's now safe to put stuff into the recyceled/new buffers. >=20 > > And an other question. Why so we have the logic to work-around the = 1Gb > > DMA limit instead of just setting the dma mask? >=20 > Because the DMA mask does not work correctly on all arches for masks = smaller than 4G. >=20 > And btw, I dont understand what that wmb() patch is supposed to fix. = There may be a wmb() missing, but rather after the ctrl _and_ the addre= ss assignment to the descriptor. > But I don't think this can cause this use-after-free anyway. >=20 I dont have the b44 specs, but : =46or sure, addr should be set before ctl, just in case ctl allows chip= to start a dma transfert (to previous packet), because a OWN bit is unset for example... A second wmb() is not necessary. It will be done eventually at next packet (we have a ring of 200 packets)