Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5596331rwb; Wed, 21 Sep 2022 09:47:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dJraBKz5gG9amOjSlvC8JxpxBSfoApI2/8V7TotUYU4mB6cb9msvwsccrJIQTag8TpNCk X-Received: by 2002:a05:6402:510f:b0:451:624f:2f02 with SMTP id m15-20020a056402510f00b00451624f2f02mr25573506edd.40.1663778850213; Wed, 21 Sep 2022 09:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663778850; cv=none; d=google.com; s=arc-20160816; b=VJmXyeMnPidx4JjjOrZjSJ+TfRs22kRu4sHwJ/JpNoW9lOOBLkLFiWxbHOV5/CHEsq CxPNOCaPk4lB2/DmRVZcp5VvwMrR+A0KCzskEyCKrVp+Lz/dOMQEnAxMQ3FSc0RaZrkX j/2ATxyD0BgwwOgysZDNkgwpIGyaudHjE8yS2qMeGoaLhJ67HxANc6bRj8L2Ex6/w2WP ZEz72xrWUhnI/8uVNLxoZOqsSzjV1JXAaczru4Bn7q30tvzwo7nKrgiOKEIgrY3Lrn9G hJHSjuCSm8vmMdXtZtqmwpkgVf2fke1Ni7M0Y/9zK0SwIsacFO6IroLVcbBLaoh40ZBG VOmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=7kE5JdBiW9yulAgHix06z8Dq9UFAx7J6x1i9LFdWSw4=; b=SEVzaZblPm5Qu3biB0uAokd6ELAXeDBYEnRLll8pglqSP++WyL1E7hRg0arUgWxN2W TEb9Wuuc1YRXHJbei7W4ood0iyLbO2UwO/3D0GNfn1nGGcq0nYK64LHwZ210gFdJliF9 YRTcpFmrf9uJljk6zB6CGIkwcbHqeLojguvDowR/a2+oGQuAdQzcoyBzbjgSTCJjNzQH R7/197bua9L5yr4V/LOWm547nGvHJa4eiNOlvw8DRHz654IRva4EwEjq75gKV903mM1g kXBggw7xrZecZLmYyhUiBtBni80CUJArCLtEOcZVRWqrNURGHJRPNusaZXtgN3k2r0F+ v7+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lxdxDMfq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp21-20020a170906c15500b007809246a12dsi2647655ejc.709.2022.09.21.09.47.09; Wed, 21 Sep 2022 09:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lxdxDMfq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbiIUQqM (ORCPT + 63 others); Wed, 21 Sep 2022 12:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbiIUQps (ORCPT ); Wed, 21 Sep 2022 12:45:48 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D012A6C15; Wed, 21 Sep 2022 09:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: 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=7kE5JdBiW9yulAgHix06z8Dq9UFAx7J6x1i9LFdWSw4=; t=1663778203; x=1664987803; b=lxdxDMfqO903d3uRan+2DNXLcDdnFsAQzU0UpWPPEzW+rRr +JSzoBf6ClUQ/g8InH2pzVpYrBdydVg48AGZ9Exgstg9LOiGHGPHhm1IIcPt/4ovLjL9i4ULunN32 0ni2TOyLdCWDGulljcaabAfvs/AM0LQaZ29tv6PhVy+0ABAjroNiERx3+VYY+fnbW7UzkWK7aHJTF 8ciuAXwub2iOz+7UW2yeXvjZhZEWMh9r78wZwWg5cd+YeK8yrhhSt42OeR22cSPWQS9Nf9rnXdiTF uUn8psPvGOWqcibQnCoSGhQkoAE2PksXkQEuIoYzLl91U+537f/k13K+fm8Xwitg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1ob2hy-004vvK-29; Wed, 21 Sep 2022 18:36:23 +0200 Message-ID: <3e819d22808f7f1f232bc1242f2260106f37f875.camel@sipsolutions.net> Subject: Re: [PATCH 1/2] cfg80211: fix dead lock for nl80211_new_interface() From: Johannes Berg To: Aran Dalton , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 21 Sep 2022 18:36:18 +0200 In-Reply-To: <20220921091913.110749-1-arda@allwinnertech.com> References: <20220921091913.110749-1-arda@allwinnertech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Wed, 2022-09-21 at 17:19 +0800, Aran Dalton wrote: > Both nl80211_new_interface and cfg80211_netdev_notifier_call hold the > same wiphy_lock, then cause deadlock. >=20 > The main call stack as bellow: >=20 > nl80211_new_interface() takes wiphy_lock > -> _nl80211_new_interface: > -> rdev_add_virtual_intf > -> rdev->ops->add_virtual_intf > -> register_netdevice The bug is yours, here, you're no longer allowed to call register_netdevice() here. If you have an out-of-tree driver that we couldn't update when doing tree-wide changes, you probably shouldn't assume that the bug is upstream and send random locking patches ... :) johannes