2021-04-12 16:43:53

by Sasha Levin

[permalink] [raw]
Subject: [PATCH AUTOSEL 4.9 23/23] cfg80211: remove WARN_ON() in cfg80211_sme_connect

From: Du Cheng <[email protected]>

[ Upstream commit 1b5ab825d9acc0f27d2f25c6252f3526832a9626 ]

A WARN_ON(wdev->conn) would trigger in cfg80211_sme_connect(), if multiple
send_msg(NL80211_CMD_CONNECT) system calls are made from the userland, which
should be anticipated and handled by the wireless driver. Remove this WARN_ON()
to prevent kernel panic if kernel is configured to "panic_on_warn".

Bug reported by syzbot.

Reported-by: [email protected]
Signed-off-by: Du Cheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
net/wireless/sme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 6fd24f6435c3..ce6823646f63 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -512,7 +512,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,

- if (WARN_ON(wdev->conn))
+ if (wdev->conn)

wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL);