Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2060160pxb; Fri, 25 Mar 2022 10:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx5HGlIVvC/ckWwGF76ju9habZLlcUmGUYP43wmgHM/EDo3ZkZhQeYNNTknJbKhprp7poL X-Received: by 2002:a05:6a00:1695:b0:4f7:decc:506b with SMTP id k21-20020a056a00169500b004f7decc506bmr11221605pfc.7.1648228963662; Fri, 25 Mar 2022 10:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648228963; cv=none; d=google.com; s=arc-20160816; b=X8huLgxhb6rDv62PtLacxEofpT2wowScKRmAYAh06OvZZd6lK9vhLmfgv+ldVpmL+o pmY8aALCJPi/Cu2SBSLlH/kV0zQy1FigbN9O83NnJHy/5baQG+WsGFkX/vu3iV/W0m3j FR3gEtZ96cFI7lkib0i4T074dFGDxPkwhGWTg4FFCL83Xqj/oJYcusMxXGb7oKGof5tJ eARuLSzh6w8YIDjMmIcW8Nm1t8ro3O6lmCROT8jLNX14/XJcCYOWKrgnNfFen67/u2wx hQLA9I8fTfyAhU94F5XZ10C8CybipBWO5hNo47B10XTuGSN8kVqIw/jzsoruhgSDRUVr lanw== 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=fP/8PQ4xnA23zU/Y+mSJsOAiECeSmsobNh7IzRsv2+I=; b=JQjIKrcD/nhGpf2Yyutx7Bj5WgIKCLDUVptSMU3rJQNcbx+CD6Qk5+O474KLoZlC5T d5+sIaTNuORVgaqSRFxzQiZRrdELBbSbuhexPJ0UzGZ6HERtL69fisM6gshmA1uX8xfB IyrpCLn6dr8/qbE4sTG7kjJJsrWppGbLwA/qwPakGI5+YqBOBezzpubMKLznIkE7xVIf WNLocSoKXtXbg35yLTXN11bNPN2BxciYWadVeVDB6sId0Zs8lFf7ke4JlKwIbe7bHYyf H5JWv5qRw5lybEpt/7NodO+AlVD/ARYqG/rA94VTmrj3F6uCAupU/Gt3jnD8MBHuhCZV tCyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=u5KBK0Ly; 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 x15-20020a17090a0bcf00b001c7a0e0d825si2946374pjd.91.2022.03.25.10.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:22:43 -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=u5KBK0Ly; 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 1C28BEF792; Fri, 25 Mar 2022 10:18:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358429AbiCYMIR (ORCPT + 70 others); Fri, 25 Mar 2022 08:08:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358984AbiCYMIN (ORCPT ); Fri, 25 Mar 2022 08:08:13 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399A5D4C9B; Fri, 25 Mar 2022 05:06:39 -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=fP/8PQ4xnA23zU/Y+mSJsOAiECeSmsobNh7IzRsv2+I=; t=1648209999; x=1649419599; b=u5KBK0LyqOXDV66G1HOp/l3f24t1TItYCTHqohUjh4ZgyzE 3BJCPFkoDxTY8dNfYl/Ig/v0ifVdnM9p5qcq0GzwKdTpApbIh8hpUWMVxsOwIRjZZpFI5BMtP+MuY kMb8q3cnGuZhdWAMLd2hRSW9gDWF6W4WyVrCWSYhLhRCJsWNX98/6+rw/7hc9HsH1LmU/wqDL4fpI 29c4trnay7SdxY8jTKsyaUuT1v1lFYZlQfUv4xx3743ftbKUtWup53u5IH8sFprl0SB2zkbSwRJ3m mlBmDQYavZ0EI0aVmYZ74pqWBCQ3AOwMAIUpQYMRztDNAs3NC2yBdDbArA9+ZV4w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nXii6-000JlI-1F; Fri, 25 Mar 2022 13:06:30 +0100 Message-ID: Subject: Re: [BUG] deadlock in nl80211_vendor_cmd From: Johannes Berg To: William McVicker , linux-wireless@vger.kernel.org Cc: Marek Szyprowski , Kalle Valo , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , kernel-team@android.com, Paolo Abeni Date: Fri, 25 Mar 2022 13:06:28 +0100 In-Reply-To: <19e12e6b5f04ba9e5b192001fbe31a3fc47d380a.camel@sipsolutions.net> References: <0000000000009e9b7105da6d1779@google.com> <99eda6d1dad3ff49435b74e539488091642b10a8.camel@sipsolutions.net> <5d5cf050-7de0-7bad-2407-276970222635@quicinc.com> <19e12e6b5f04ba9e5b192001fbe31a3fc47d380a.camel@sipsolutions.net> 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 13:04 +0100, Johannes Berg wrote: > > So we can avoid the potential deadlock in cfg80211 in a few ways: > > 1) export rtnl_lock_unregistering_all() or maybe a variant after > refactoring the two versions, to allow cfg80211 to use it, that way > netdev_run_todo() can never have a non-empty todo list > > 2) export __rtnl_unlock() so cfg80211 can avoid running > netdev_run_todo() in the unlock, personally I like this less because > it might encourage random drivers to use it > > 3) completely rework cfg80211's locking, adding a separate mutex for > the wiphy list so we don't need to acquire the RTNL at all here > (unless the ops need it, but there's no issue if we don't drop it), > something like https://p.sipsolutions.net/27d08e1f5881a793.txt > Note that none of these actually let you do what you wanted - that is acquiring the RTNL in the vendor op itself. johannes