linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Du Cheng <ducheng2@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>,
	syzbot+5f9392825de654244975@syzkaller.appspotmail.com
Subject: Re: [PATCH] net: wireless: convert WARN_ON() to pr_warn() in cfg80211_sme_connect
Date: Wed, 7 Apr 2021 07:54:22 +0200	[thread overview]
Message-ID: <YG1JDsaRpws1FkzI@kroah.com> (raw)
In-Reply-To: <20210407021903.384158-1-ducheng2@gmail.com>

On Wed, Apr 07, 2021 at 10:19:03AM +0800, Du Cheng wrote:
> A WARN_ON(wdev->conn) would trigger in cfg80211_sme_connect(), if
> multiple send_msg() system calls are made from the userland, which
> should be anticipated and handled by the wireless driver. Convert this
> WARN() to pr_warn to prevent a kernel panic if kernel is configured to
> "panic on warn".
> 
> Bug reported by syzbot.
> 
> Reported-by: syzbot+5f9392825de654244975@syzkaller.appspotmail.com
> Signed-off-by: Du Cheng <ducheng2@gmail.com>
> ---
> link to syzkaller:
> https://syzkaller.appspot.com/bug?extid=5f9392825de654244975
> this patch has passed syzbot test.
>  net/wireless/sme.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
> index 07756ca5e3b5..87a65a4c40ae 100644
> --- a/net/wireless/sme.c
> +++ b/net/wireless/sme.c
> @@ -529,8 +529,10 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,
>  		cfg80211_sme_free(wdev);
>  	}
>  
> -	if (WARN_ON(wdev->conn))
> +	if (wdev->conn) {
> +		pr_warn("%s: wdev->conn != NULL, sme connect in progress", __func__);

You have a real device, please always use 'dev_warn() for stuff like
this, or the netdev equivalent.  Also no need for __func__ for stuff
like this, that's just clutter.

Also, what can a user do if they get this information?  What does it
mean to them?  Try making the text more informative.

thanks,

greg k-h

  reply	other threads:[~2021-04-07  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  2:19 [PATCH] net: wireless: convert WARN_ON() to pr_warn() in cfg80211_sme_connect Du Cheng
2021-04-07  5:54 ` Greg Kroah-Hartman [this message]
2021-04-07 15:47   ` Du Cheng
2021-04-07 15:51     ` Johannes Berg
2021-04-07 16:18       ` Du Cheng

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=YG1JDsaRpws1FkzI@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=ducheng2@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+5f9392825de654244975@syzkaller.appspotmail.com \
    /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).