linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: wireless: convert WARN_ON() to pr_warn() in cfg80211_sme_connect
@ 2021-04-07  2:19 Du Cheng
  2021-04-07  5:54 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Du Cheng @ 2021-04-07  2:19 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless, Greg Kroah-Hartman, Shuah Khan, Du Cheng,
	syzbot+5f9392825de654244975

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__);
 		return -EINPROGRESS;
+	}
 
 	wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL);
 	if (!wdev->conn)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-07 16:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-04-07 15:47   ` Du Cheng
2021-04-07 15:51     ` Johannes Berg
2021-04-07 16:18       ` Du Cheng

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).