Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2214389pxb; Fri, 25 Mar 2022 13:10:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDI25jAlhnKOG6Hflt/dFDY0lTfmvyP0uEYLy/bxTdrxERV36+GBws5EYtC2qfOnMhNpN9 X-Received: by 2002:a05:6a00:1381:b0:4f6:e4ba:2d64 with SMTP id t1-20020a056a00138100b004f6e4ba2d64mr11848699pfg.24.1648239057003; Fri, 25 Mar 2022 13:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648239056; cv=none; d=google.com; s=arc-20160816; b=bG9ajoYAwLkoXP34PHv8JwfoaojA968gFo13J+iW6JdqLwrseWfdRQ2eWr9ujo6INJ 7ZgiJ+a3pTb7DfeVIjY/EPrBri+wBV3HDgx5++0AXaRgQre3gHfib5IhRAS4jy/8kJEf WJyV41v8MtwF+92oV6HoUjGNECebiDBMRkOsM+nWq8PitwkZkYQz+yfn9LyR2eTnm3hS 4Um3+xNDrSx2Elssm1x/ZwukUNG1GvuWWgoBJpzfRL8Fbw9ObqV+XDfxaLuUlV+MFcjy T200sLcT7fQWZWeurfsfzEq/mq6+HCfP9nTj6ckSWPZ+FlTQZ429AylfQaZ9545jlyXf aUHQ== 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=5B5wAq5LfyAkih3V2BMgc+HmWAEd6qH7oOxOQfkzsDc=; b=jARUd67cXtLriHB9HzAsA6qssvBuexh/vLgny/fxsCjn5o+VJb3F1JqkH1Z97wrQUu rzYTQxqujlnrw+aCqh5aMV0CTEWmngi7jjeG4V+tkLAQ19KFrNNSnfj2i2QyGWUaojZk qkTSwcM8RsDISR8reTeXc4rwQYTRRxg0PklEpKWrIYQjanz6IEHdsbSMTOUUgj6kjBlj xwZt0EZDhuPb70ecZa15x9u6gOpd8fwpuDdHVt32IKj4q7wImI7LRaer2fkrlquy2tby iWc5mU3y/+0RZkUsH83d/xk0roeUspjX3bCnpTreXOvOxS4jH5PDqdRghZXl4W15MV3e NVyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=S47SHmZR; 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 o6-20020a17090aac0600b001c6f8962d27si6433736pjq.116.2022.03.25.13.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:10:56 -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=S47SHmZR; 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 576D33B207A; Fri, 25 Mar 2022 11:53:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357495AbiCYMJn (ORCPT + 70 others); Fri, 25 Mar 2022 08:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347349AbiCYMJl (ORCPT ); Fri, 25 Mar 2022 08:09:41 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F241F5FBC for ; Fri, 25 Mar 2022 05:08:06 -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=5B5wAq5LfyAkih3V2BMgc+HmWAEd6qH7oOxOQfkzsDc=; t=1648210087; x=1649419687; b=S47SHmZR3y62K4Mc2WoIbu1mce9AVQL554ybkrsDjxemM7y NLQr/i9UBbmlYP8rVlwvYaDqDWP+0ReodbFJ3mwadqqx3wB1LAaIIc2EWMNLrS2vvopCQL23+X4Zw ShDrL65KnxX5YyyPO9I5gvYOOuinVwOSMfH2AgBHcCm+Gn6+EtpF74vMmOjOecRH5vx83g2siIusu aCQoKda4U3mS6viu195VUqciijOnN1jp4FL9y9bO9DlDutf5nLRLbhG2czVVfOrhALUE8NY6yW1uh I67oDYHdWYw+W228DuRuGgcPJr0FmkldlPrb71g3QZnjE+rRNK9wegQne4K1bx+A==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nXijb-000Jne-I1; Fri, 25 Mar 2022 13:08:03 +0100 Message-ID: <365254338aba8caa588096e532ed54d094b06345.camel@sipsolutions.net> Subject: Re: [BUG] deadlock in nl80211_vendor_cmd From: Johannes Berg To: Jeff Johnson , willmcvicker@google.com, linux-wireless@vger.kernel.org Cc: Marek Szyprowski Date: Fri, 25 Mar 2022 13:08:02 +0100 In-Reply-To: <5d5cf050-7de0-7bad-2407-276970222635@quicinc.com> References: <0000000000009e9b7105da6d1779@google.com> <99eda6d1dad3ff49435b74e539488091642b10a8.camel@sipsolutions.net> <5d5cf050-7de0-7bad-2407-276970222635@quicinc.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 Tue, 2022-03-22 at 14:31 -0700, Jeff Johnson wrote: > On 3/21/2022 1:07 PM, Johannes Berg wrote: > [..snip..] > > > > I'm not an networking expert. So my main question is if I'm allowed to take > > > the RTNL lock inside the nl80211_vendor_cmd callbacks? > > > > Evidently, you're not. It's interesting though, it used to be that we > > called these with the RTNL held, now we don't, and the driver you're > > using somehow "got fixed" to take it, but whoever fixed it didn't take > > into account that this is not possible? > > On this point I just want to remind that prior to the locking change > that a driver would specify on a per-vendor command basis whether or not > it wanted the rtnl_lock to be held via NL80211_FLAG_NEED_RTNL. No, that flag isn't on a per-vendor-command basis. It was set for all the vendor commands though, in nl80211, so the driver wouldn't have had the rtnl_lock()/unlock() at all. johannes