Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp902038pxf; Wed, 7 Apr 2021 14:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfk3S1XhwZcKl0oPSewfeG6DwqNhF+M5Ayo6DXV5PYsvvO629ZpYnsu6/7pWsYVpMlDryt X-Received: by 2002:a50:fb84:: with SMTP id e4mr6993423edq.92.1617831354688; Wed, 07 Apr 2021 14:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617831354; cv=none; d=google.com; s=arc-20160816; b=h2FO7YCpX1zoxgNWf94xAMR6kVrYn87a8/iy/mHXbjQx+gS1tzMsDNzQ4t9uQjbPL5 oGoBO9hbxSBfjcONtyUMmN4g7v9L27D2DiuzkVqWd4RTCF+Lvlws+SxF+EmZC1AQWeKN W4UtpZuVWyhwUsVt6cjw2z6RoPL+jqKBMN1JwdjUweglG8+vo6qMsPMjjqPrp8FMeZCB qa02lzN3fDUBDv9IvrhQpq1QheKWndhDiuxL2KdY/Axip2IQFK5nw3nDWf62/J/bcgy5 zLLKw0DVfFUiEY6d9CmwPFJfUaEuvQBCLWV0PHwzRPDASL3rMtsZubKUvG29FtDD+ePr tBNg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=i4I5dtBIlPg4tLUu7MrbY6e8JWEuxRneUypscy5Rvhs=; b=sZrgOVeCp8/kL/dhGWBEFti6YdGmYXLDcAwBt4EjEuMtvr79sQVMMOxv10whFwMRkM 3yj3fT06H5Lydb3vtl+auizHkQ8pR2UWZXJ6PUvV3pjgMRYf5LWmLpzx12ZeAInKggg6 +v5JbECxoB2G9Et9qACADdBkinNGle1miY7DGya8IpwS1hm8z98zdCjY/dICdzfrMHzC HzidXrzcCYnO+ZXDXKxwlkid5SVdHsY5ZtrFyS83y6wqdBFHcz5t7dUMwpFkLGoYx2m7 xsH0yniHaffc++ND/yxbGac+GBHNs6oEaUgquio5P5ZTZVBF54uhrvzbLp/EmlGmGrYw gymA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tKUEJxP7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq19si20423796ejc.88.2021.04.07.14.35.31; Wed, 07 Apr 2021 14:35:54 -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=@gmail.com header.s=20161025 header.b=tKUEJxP7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242613AbhDGQS5 (ORCPT + 99 others); Wed, 7 Apr 2021 12:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232492AbhDGQS4 (ORCPT ); Wed, 7 Apr 2021 12:18:56 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92435C061756 for ; Wed, 7 Apr 2021 09:18:45 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id t22so6294115pgu.0 for ; Wed, 07 Apr 2021 09:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=i4I5dtBIlPg4tLUu7MrbY6e8JWEuxRneUypscy5Rvhs=; b=tKUEJxP7prEW1SfeeTyF/6GnPYSZ2yYGi6g+3Ol8+zjiuQCCAucEUJRSK9SK5j2+Ks EF7gVWxDD3ZwlC1esvKXNWQVUrfKcjfBDjQyNlypgA8WgzYcniMFGVnDDDE/XAVQPBpJ Q8q7VVOFtKvIKgyCguNENHt5xVCJgFrWzUjaD2OimxwylwjzPIxIpGR320cmwRb/kUO7 oaOo5dtj7uPM4tSreIZ32ZfZ6JY+hn9aAqgrXMPXN0zey/f+4X10vV4K8+ZSZA3gy+lp 5Jti8x0FONCuEDqPvtFITPvPBqaCUE/0S7bPUslkKMKEWwOv3s3Kfrgvc6rXcu1YvXz9 ZDNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=i4I5dtBIlPg4tLUu7MrbY6e8JWEuxRneUypscy5Rvhs=; b=o11o2MZ03isRwbmWXSh6388qGYzOzSKBtWtewE4wXQM48LSOlXS+mBp4Sij86x9AvU VsNPcAMo6qXIMKq06ytNSJHJUrnoszZi108huO2Siaa/OUuG9gI1BXfGCLTK15PLJXX4 skkvEDwUw/IH2oyEJ0DxwZ6rLTAJFNGdt1rf3zm8J+ETBEQhXMo8dizJ/A/lUVE8N+7y KOVCG3iWSYmP1iGn9rO807mGyHTj38P31YnAB6qvsoIfK6T/jT//5yg2L1DJjdKUzn88 /NPV8ky9Lhxbjq/Rbqjv4EAjWrOKs70LPSXS55+kEY5VT7QsprpQ6km9WZWxtnnFBhPS LcMg== X-Gm-Message-State: AOAM532A46AXlFrfBrU6eLkTLetpicAe2tqc6pvdhRY07y5R0d1poABu 6KYUY01FPyPsBNLEdd25X855ZQHX3M0sdy0i X-Received: by 2002:a63:531b:: with SMTP id h27mr3982846pgb.395.1617812325151; Wed, 07 Apr 2021 09:18:45 -0700 (PDT) Received: from carbon ([202.133.196.154]) by smtp.gmail.com with ESMTPSA id q66sm6086576pja.27.2021.04.07.09.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 09:18:44 -0700 (PDT) Date: Thu, 8 Apr 2021 00:18:40 +0800 From: Du Cheng To: Johannes Berg Cc: Greg Kroah-Hartman , 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> <043656c28804db4f8c3dfc9eae5a599ac3a357c7.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <043656c28804db4f8c3dfc9eae5a599ac3a357c7.camel@sipsolutions.net> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Le Wed, Apr 07, 2021 at 05:51:05PM +0200, Johannes Berg a écrit : > Hi, > > > I have spent some time to understand the netlink subsystem as a IPC mechanism. > > What I have now is a reliable sequence of steps to reproduce the crash, by > > condensing the syzkaller C reproducer: > > [link to reproducer: https://syzkaller.appspot.com/text?tag=ReproC&x=1414c997900000] > > > > * hwsim80211_create_device (sendmsg: HWSIM_CMD_NEW_RADIO) > > * nl80211_set_interface (sendmsg: NL80211_CMD_SET_INTERFACE) > > * set_interface_state (ioctl: SIOCSIFFLAGS) > > * nl80211_join_ibss (sendmsg: NL80211_CMD_JOIN_IBSS) > > * sendmsg: NL80211_CMD_SET_INTERFACE > > * 1st sendmsg: NL80211_CMD_CONNECT > > * 2nd sendmsg: NL80211_CMD_CONNECT <- this triggers the WARN_ON(wdev->conn) > > * (if kernel not panic yet) more sendmsg: NL80211_CMD_CONNECT ... > > > > If the code skips WARN_ON() and instead returns -EINPROGRESS, user application > > will receive error from the following recv(sock, ...). User application can hence > > choose to handle this error accordingly while kernel soldiers on without panicking. > > > > If dev_warn() is added, for every subsequent NL80211_CMD_CONNECT, the console is > > flooded with the printout. > > > > Maybe it is ok to silently return -EINPROGRESS for the 2nd NL80211_CMD_CONNECT > > and beyond. > > > > Yeah, I think the right thing to do is to just drop the WARN_ON > entirely. In fact, I can't really seem to figure out now why it was > added there (even if I probably did that myself), nothing else seems to > prevent getting to this code path multiple times directly one after > another. > > johannes > Hi Johannes, Thanks for your input! I will send a v2 that drops the WARN_ON(). Regards, Du Cheng