From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Felix Fietkau <nbd@openwrt.org>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/2] mac80211: validate skb->dev in the tx status path
Date: Fri, 07 Sep 2012 08:37:20 -0700 [thread overview]
Message-ID: <504A14B0.4020104@candelatech.com> (raw)
In-Reply-To: <1347031704.4256.26.camel@jlt4.sipsolutions.net>
On 09/07/2012 08:28 AM, Johannes Berg wrote:
> On Fri, 2012-09-07 at 08:24 -0700, Ben Greear wrote:
>> On 09/07/2012 07:54 AM, Felix Fietkau wrote:
>>> skb->dev might contain a stale reference to a device that was already
>>> deleted, and using it unchecked can lead to invalid pointer accesses.
>>> Since this is only used for nl80211 tx, iterate over active interfaces
>>> to find a match for skb->dev, and discard the tx status if the device
>>> is gone.
>>
>> Nasty performance hit if we have lots of virtual
>> interfaces, eh? Maybe some sort of ref-counting
>> would be better? Or a hashed lookup on the netdev
>> pointer/token?
>
> As Felix also pointed out to me, no. Frames that need to go to nl80211
> should be rare, this isn't the common case.
Ahh, ok. I was thinking each transmitted pkt would cause this code
to run.
Thanks,
Ben
>
> johannes
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
prev parent reply other threads:[~2012-09-07 15:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 14:54 [PATCH 1/2] mac80211: validate skb->dev in the tx status path Felix Fietkau
2012-09-07 14:54 ` [PATCH 2/2] mac80211: prevent work queueing while quiescing on suspend Felix Fietkau
2012-09-09 9:15 ` Arik Nemtsov
2012-09-09 11:59 ` Arik Nemtsov
2012-09-07 15:11 ` [PATCH 1/2] mac80211: validate skb->dev in the tx status path Johannes Berg
2012-09-07 15:27 ` Felix Fietkau
2012-09-07 15:24 ` Ben Greear
2012-09-07 15:28 ` Johannes Berg
2012-09-07 15:37 ` Ben Greear [this message]
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=504A14B0.4020104@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@openwrt.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).