From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2.6.40] wl12xx: fix oops in sched_scan when forcing a passive scan
Date: Thu, 26 May 2011 07:51:09 +0300 [thread overview]
Message-ID: <1306385469.12586.2403.camel@cumari> (raw)
In-Reply-To: <BANLkTim4Gf8GVTqj7wcZrdGG6MM0mpTEvw@mail.gmail.com>
On Thu, 2011-05-26 at 02:08 +0300, Eliad Peller wrote:
> hi Luca,
>
> On Wed, May 25, 2011 at 7:16 PM, Luciano Coelho <coelho@ti.com> wrote:
> > Fix kernel oops when trying to use passive scheduled scans. The
> > reason was that in passive scans there are no SSIDs, so there was a
> > NULL pointer dereference.
> >
> > To solve the problem, we now check the number of SSIDs provided in the
> > sched_scan request and only access the list if there's one or more
> > (ie. passive scan is not forced). We also move the channels from
> > active to passive if passive scanning is forced. For this to work,
> > it's necessary to set both active and passive dwell times for all
> > channels.
> >
> > Signed-off-by: Luciano Coelho <coelho@ti.com>
> > ---
> [...]
>
> why does sched scan without ssids means passive scan? can't we just do
> active sched scan without ssids?
This is how normal scans also work. If you want a broadcast scan, you
pass a wildcard SSID (ie. one with zero length), if you want to force
the scan to be passive, you don't pass any SSIDs in the request.
Basically it means that if there is not SSID, we cannot send probe_req
(even broadcast probe_reqs need an SSID, an empty one).
> > + if (force_passive) {
> > + /* move active channels to passive lists */
> > + cfg->passive[0] += cfg->active[0] - 1;
> > + cfg->active[0] = 1;
> looks like a potential integer underflow.
>
> if you're forcing a passive scan, why do you need to set an active channel?
Argh! This was from a test I was doing and is totally wrong. The idea
is to transfer all the active channels to the passive list. Thanks for
noticing this, I'll fix it.
> anyway, this seems a bit wrong.
>
> i don't think you can just do "arbitrary transfers" of the channel
> counts, as their order seem to matter (i.e. the order of elements in
> the channel array is passive[0],passive[1],..,active[0],active[1]...,
> so you actually need to shift all the elements)
Hmmm... Good point. I don't know why the order would actually matter,
but in this case the way the channels are scanned will be hard to
predict. We're doing something that is not specified or requested
anywhere.
This seemed to be the simplest way to do it, but indeed it's not very
good. I'll have to do something so that it already sets all the
channels as passive when it generates the list, so no reordering or
hacking the channel numbers will be necessary.
Thanks for the review!
--
Cheers,
Luca.
prev parent reply other threads:[~2011-05-26 4:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 16:16 [PATCH 2.6.40] wl12xx: fix oops in sched_scan when forcing a passive scan Luciano Coelho
2011-05-25 23:08 ` Eliad Peller
2011-05-26 4:51 ` Luciano Coelho [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=1306385469.12586.2403.camel@cumari \
--to=coelho@ti.com \
--cc=eliad@wizery.com \
--cc=linux-wireless@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