linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Eric Biggers <ebiggers3@gmail.com>,
	kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, Stable <stable@vger.kernel.org>
Subject: Re: [PATCH V3 for 3.19]  rtlwifi: Fix error when accessing unmapped memory in skb
Date: Mon, 12 Jan 2015 02:12:23 +0000	[thread overview]
Message-ID: <1421028743.19708.44.camel@decadent.org.uk> (raw)
In-Reply-To: <54A4665A.8090906@lwfinger.net>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

On Wed, 2014-12-31 at 15:10 -0600, Larry Finger wrote:
> On 12/30/2014 11:07 PM, Eric Biggers wrote:
> > On Tue, Dec 30, 2014 at 09:33:07PM -0600, Larry Finger wrote:
> >> v3 - Unmap skb before trying to allocate a new one so as to not leak mapping.
> >
> > Looks good to me, although I'm not sure about the handling of DMA mapping errors
> > (perhaps that's something that drivers typically don't even try to handle?).
> > Anyway, the skb allocation issue appears to be resolved now.  I am running your
> > patch with an extra hack to inject some occasional skb allocation failures, and
> > I haven't noticed any problems except dropped packets.
> 
> The last time I saw any DMA mapping errors were for some early BCM43xx cards 
> that only had 20 bits of DMA addressing space. These Realtek devices have a full 
> 32 bits of addressing, thus any physical address in the first 4GB of RAM will be 
> OK. I suppose that it might be possible to get a physical address outside this 
> range for machines with a lot of RAM, but they are unlikely to have wifi interfaces.
[...]

Really, you don't think laptops and desktops come with 4GB RAM or more?
Besides that, DMA mapping may involve calling an IOMMU driver that may
fail for some reason.

Drivers need to check for DMA mapping errors, it is not optional.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2015-01-12  2:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-31  3:33 [PATCH V3 for 3.19] rtlwifi: Fix error when accessing unmapped memory in skb Larry Finger
2014-12-31  5:07 ` Eric Biggers
2014-12-31 21:10   ` Larry Finger
2015-01-12  2:12     ` Ben Hutchings [this message]
2015-01-05  8:07 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421028743.19708.44.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=Larry.Finger@lwfinger.net \
    --cc=ebiggers3@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).