lkml.org 
[lkml]   [2021]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 22/38] cfg80211: remove WARN_ON() in cfg80211_sme_connect
    Date
    From: Du Cheng <ducheng2@gmail.com>

    commit 1b5ab825d9acc0f27d2f25c6252f3526832a9626 upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    net/wireless/sme.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/wireless/sme.c
    +++ b/net/wireless/sme.c
    @@ -507,7 +507,7 @@ static int cfg80211_sme_connect(struct w
    if (wdev->current_bss)
    return -EALREADY;

    - if (WARN_ON(wdev->conn))
    + if (wdev->conn)
    return -EINPROGRESS;

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

    \
     
     \ /
      Last update: 2021-04-15 17:09    [W:4.272 / U:0.444 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site