Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2312962pxb; Fri, 25 Mar 2022 15:15:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyvlxJbYDV1qXayfnrPQs/O07zjO0HUCjwkeSHG/PNN1sYRwQi02uyOaA7i3fSh/zpIrFZ X-Received: by 2002:a17:90b:4b47:b0:1c7:7c38:57d9 with SMTP id mi7-20020a17090b4b4700b001c77c3857d9mr21536170pjb.241.1648246514207; Fri, 25 Mar 2022 15:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648246514; cv=none; d=google.com; s=arc-20160816; b=oR00fcT4FkDFqaRDkQh3qcXwJ13z0z5iZFj+fePO2U7bF41B9GMrSmxP588+cl7h39 QAEO6LnyyPRDg7WsZxxPeqY5wyRDDMWs8qEPb6AIf4nt3OXo6j9yAfUODfZ5Wlh/mBc1 Ka0XsLjv53zLhGgi5TfUyuolSzTMbVgSvcFPQDBngCkVP6EEEcBgIny9jrYsNq4QtVBb uy/YAZhQ03nBAi8c3RApDgL8UwaAHLWJh6+9iK117TdBwU3mqDVHsaGBoY3zQjUzjHjI M46Sw5JmeDdg8m8kuHLVVgwBzqdO8ToyG1ntY0Xw3ct6ARnP9Rj21uLLBDg4YLpKwIfp LnAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=60OMP8UDGCo2v151LkV47kmUGiZyavD4SmhjdQ5wwUk=; b=IkuY6P4t/NZm/s+nSpD925I53Cvuq2SfCk9+XBpiQI1ANkFi0Ad3RF7KwYGcCzH/4n IyPdBj92okwXDXMEM6eBtBVE8airUudPj8vsKVEBu3mK0aJdzsH2jNjJuUnE1Azyqmoh BSfrmoEXkQrxunQPxi3TYobIKgyc6KsUtvknXXZm/yMcrDBK1FPOniJDj3tgfgCD9Fks x8HNqxPiugF5LLbIO7qYMSPM0KYJjdN6SQGV4arXsz84y3auaslLcwEAqfggtA1cXX4t i65d3tQoqgjljF0Ue5w1KASxQEoe4/0TjEn6J+Pb7Y/c6T6QfieYx1wYQV4qVfsROayO FKzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=wYVrZW7E; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z8-20020aa78888000000b004fa7d166af8si4417575pfe.52.2022.03.25.15.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 15:15:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=wYVrZW7E; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1FEE416AA42; Fri, 25 Mar 2022 14:50:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbiCYVvr (ORCPT + 70 others); Fri, 25 Mar 2022 17:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233563AbiCYVvq (ORCPT ); Fri, 25 Mar 2022 17:51:46 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF7DA15AAF8; Fri, 25 Mar 2022 14:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=60OMP8UDGCo2v151LkV47kmUGiZyavD4SmhjdQ5wwUk=; t=1648245011; x=1649454611; b=wYVrZW7EwtB7mSEvSZ48TSGqoD9G9nav/Xj/aVH2Ib2yAce RX3J3RP/52Q90qv9LiY0KlobTo7jU2A3uKwLgY7YVBfMKk67kDCdAlRb1ongtxJB3dTI34es2MB4q T+/x5KQUFAPox6K1T7gOFW8Ubd0U8p5ucJU9HS3z1b2XqWGjwtVl79gq1D8nscdcPrcnCUw3WnAyV Qy0a+pjITCur8Q6jWf9Jul+EiOUsWRX22l//PcxSYTlVhTP7AHHYy/KQdKgr5ZhJirry2OaFXr/+j xAtAUCZ+3Ie0J83VsU9ZXluK8GIvzQ/G2OgqBOOQtb2Qu8Ovb0G0iNzHbQnIqjiA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nXrop-000WYJ-N0; Fri, 25 Mar 2022 22:50:03 +0100 Message-ID: Subject: Re: [BUG] deadlock in nl80211_vendor_cmd From: Johannes Berg To: Jakub Kicinski Cc: William McVicker , linux-wireless@vger.kernel.org, Marek Szyprowski , Kalle Valo , "David S. Miller" , netdev@vger.kernel.org, Amitkumar Karwar , Xinming Hu , kernel-team@android.com, Paolo Abeni , Eric Dumazet , Cong Wang , Cong Wang , "Eric W. Biederman" Date: Fri, 25 Mar 2022 22:50:02 +0100 In-Reply-To: <20220325144839.7110fc8d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <0000000000009e9b7105da6d1779@google.com> <99eda6d1dad3ff49435b74e539488091642b10a8.camel@sipsolutions.net> <5d5cf050-7de0-7bad-2407-276970222635@quicinc.com> <19e12e6b5f04ba9e5b192001fbe31a3fc47d380a.camel@sipsolutions.net> <20220325094952.10c46350@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20220325134040.0d98835b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <46b8555d4cded50bc5573fd9b7dd444021317a6b.camel@sipsolutions.net> <20220325144839.7110fc8d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2022-03-25 at 14:48 -0700, Jakub Kicinski wrote: > > > > > The WARN_ON() you suggested up front make perfect sense to me. > > > You can also take the definition of net_unlink_todo() out of > > > netdevice.h while at it because o_0 > > > > Heh indeed, what? > > To be clear - I just meant that it's declaring a static variable in > a header, so I doubt that it'll do the right thing unless it's only > called from one compilation unit. Right, it's odd. I just made a patch (will send in a minute) moving the entire block to dev.c, which is the only user of any of it. > > Ah, no. This isn't about locking in this case, it's literally about > > ensuring that free_netdev() has been called in netdev_run_todo()? > > Yup, multiple contexts sitting independently in netdev_run_todo() and > chewing on netdevs is slightly different. destructors of those netdevs > could be pointing at memory of a module being unloaded. Right, thanks. johannes