]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cfg80211: remove WARN_ON() in cfg80211_sme_connect
authorDu Cheng <ducheng2@gmail.com>
Wed, 7 Apr 2021 16:27:56 +0000 (00:27 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Apr 2021 08:14:55 +0000 (10:14 +0200)
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: syzbot+5f9392825de654244975@syzkaller.appspotmail.com
Signed-off-by: Du Cheng <ducheng2@gmail.com>
Link: https://lore.kernel.org/r/20210407162756.6101-1-ducheng2@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/sme.c

index 07756ca5e3b5960198955db356741be90b9355c5..08a70b4f090cc28b7aed3afe5dd61e4f9542e87b 100644 (file)
@@ -529,7 +529,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,
                cfg80211_sme_free(wdev);
        }
 
-       if (WARN_ON(wdev->conn))
+       if (wdev->conn)
                return -EINPROGRESS;
 
        wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL);