From: Zhu Yi <yi.zhu@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: potential null dereference in ipw_wx_set_scan()
Date: Tue, 03 Feb 2009 17:18:59 +0800 [thread overview]
Message-ID: <1233652739.5990.238.camel@debian> (raw)
In-Reply-To: <alpine.DEB.2.00.0902012132350.2949@bikeee>
On Tue, 2009-02-03 at 16:21 +0800, Dan Carpenter wrote:
> I'm testing out my code checker (http://repo.or.cz/w/smatch.git/).
>
> It complains about ipw_wx_set_scan() from
> drivers/net/wireless/ipw2x00/ipw2200.c
>
> Can the "if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { " from line 9522
> ever be false? If the conditions on lines 9516 and 9522 were both false
> then 'work' would still be NULL. That causes a null dereference in
> queue_delayed_work() on line 9534.
Yes. I guess we never hit this because no one is using iw_scan_req other
than IW_SCAN_THIS_ESSID. Patch is welcome.
Thanks,
-yi
> 9515 if (wrqu->data.length == sizeof(struct iw_scan_req)) {
> 9516 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
> 9517 int len = min((int)req->essid_len,
> 9518 (int)sizeof(priv->direct_scan_ssid));
> 9519 memcpy(priv->direct_scan_ssid, req->essid, len);
> 9520 priv->direct_scan_ssid_len = len;
> 9521 work = &priv->request_direct_scan;
> 9522 } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
> 9523 work = &priv->request_passive_scan;
> 9524 }
> 9525 } else {
> 9526 /* Normal active broadcast scan */
> 9527 work = &priv->request_scan;
> 9528 }
prev parent reply other threads:[~2009-02-03 9:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 8:21 potential null dereference in ipw_wx_set_scan() Dan Carpenter
2009-02-03 9:18 ` Zhu Yi [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=1233652739.5990.238.camel@debian \
--to=yi.zhu@intel.com \
--cc=error27@gmail.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;
as well as URLs for NNTP newsgroup(s).