Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp622770pxf; Wed, 7 Apr 2021 07:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4H879IF8ZZW6VyRYMk+gMRq0XjFRQCSYCBSX+Q3K8xkVmzyADkUJ3MU17nVJFLZ0ymJKQ X-Received: by 2002:a50:d84e:: with SMTP id v14mr4996275edj.357.1617807034684; Wed, 07 Apr 2021 07:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617807034; cv=none; d=google.com; s=arc-20160816; b=TigtZorIVpMi6CcKj6f35xruKZeUaq+VL4zdoZ/bw2F+KoBNVai2b0rtXQl1EbPsv/ e7QmsTtD5X2Lva0BlQQ6tWIfj+ozyVMgLPul/CY1MyP890QOhLEUKuYTMGXEw3VqJMnZ ZDNxl+p7Ent3iPNZ9iYG3dhc+CvJZepV+UKnQI7tn7DI2V4CeW8H4Tl+2EliwjHc0hUb RjAcffpE53az0/tGnnFc+x5i0newtmq4AAWc2fzBOqCJb7+hsoFbBjJVcwCAPWgkjKja VfkE8Uftx8XDkFxwfcXTA9z4hD/URAER2PWe4/23sYqSHDpXk+UDOSzIBGxxGYffC37Y d51A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9KPRSVIfuUK4UJwWi3aFjbTSCVFNUiLZuUVxPOtR0Bs=; b=Q91YE7Qh9QwYZdI76ZoGqvr6HAo4sDbYJ8gJQI2YbdBSlSXTgwhk3dXxJN+14dT219 Zf/+752vUm2+weJQMPzK3A562v6Urg7a5E3P89xlzNVcqbXUOA9NlGDjLNRfwFlAcLov q8lJqQMcYZy/v0yx1THBDuoxmJ6sHxdTHhP5MBHJX+KevybDYWSIXWB18WCbJo+1XuFc Nh+8ooPgQAdIK4qq8l2lwfiZKTUpxYKncTT9YPM5cx/ezCaTgP3bsCgG6spz8KsiYWaX ZXPsgMyoc4AGhraoQC1341hI7NN1XscorA+05N+dblNVPHxXcp6xyI9LZq7Q+LfJOva4 48RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vPaOS3fQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si4234049eje.91.2021.04.07.07.50.07; Wed, 07 Apr 2021 07:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vPaOS3fQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344858AbhDGFyf (ORCPT + 99 others); Wed, 7 Apr 2021 01:54:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:41626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243610AbhDGFyf (ORCPT ); Wed, 7 Apr 2021 01:54:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD9D66139B; Wed, 7 Apr 2021 05:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617774865; bh=LhBy7QXsuE9/aFZMQru+IxA36pqYuIRIfddA1HAvekM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vPaOS3fQXeAE1WHslGB1ZQ4kuTzdrDIIxOVi1g1AXd10kbyBlsAvfhfaMgTB9I2Oe fs7daSn8oN7O+1iEsJnFIX5KpKQr7F0ANPlpkCoiV0g+AacmDFB+UOe5NXLStffAkq nlmGec4sPL/xf+tQZ1ztSCdxDqnyUcX9ipna5X+Q= Date: Wed, 7 Apr 2021 07:54:22 +0200 From: Greg Kroah-Hartman To: Du Cheng Cc: Johannes Berg , linux-wireless@vger.kernel.org, Shuah Khan , syzbot+5f9392825de654244975@syzkaller.appspotmail.com Subject: Re: [PATCH] net: wireless: convert WARN_ON() to pr_warn() in cfg80211_sme_connect Message-ID: References: <20210407021903.384158-1-ducheng2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407021903.384158-1-ducheng2@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 > --- > 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