Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [bug report] wifi: nl80211: support MLO in auth/assoc
Date: Wed, 22 Jun 2022 10:11:42 +0200	[thread overview]
Message-ID: <0ee06d5296b836312346e23e7876ede8655835a0.camel@sipsolutions.net> (raw)
In-Reply-To: <YrK+sjPSFRxX4XAM@kili>

On Wed, 2022-06-22 at 10:03 +0300, Dan Carpenter wrote:
> The patch d648c23024bd: "wifi: nl80211: support MLO in auth/assoc"
> from May 31, 2022, leads to the following Smatch complaint:
> 
>     net/wireless/mlme.c:328 cfg80211_mlme_assoc()
>     warn: variable dereferenced before check 'req->bss' (see line 324)
> 
> net/wireless/mlme.c
>    323	
>    324		err = rdev_assoc(rdev, dev, req);
>                                             ^^^
> req->bss dereferenced inside the function call
> 
>    325		if (!err) {
>    326			int link_id;
>    327	
>    328			if (req->bss) {
>                             ^^^^^^^^
> Check for NULL is too late
> 

I was writing why all of this is correct but now I realized that
literally in rdev_assoc() we dereference it ... that's obviously
garbage, I need to adjust the tracing for all of this.

But anyway I should move that into the tracing.

For now this is fine because you can't get here with req->bss == NULL
(which would imply req->link[i] != NULL for some value(s) of i) because
no driver advertises MLO support.

Thanks for the report!

johannes

      reply	other threads:[~2022-06-22  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  7:03 [bug report] wifi: nl80211: support MLO in auth/assoc Dan Carpenter
2022-06-22  8:11 ` Johannes Berg [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=0ee06d5296b836312346e23e7876ede8655835a0.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=dan.carpenter@oracle.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