Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2247505pxb; Fri, 25 Mar 2022 13:52:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyME6JLZrBbuFKUP9SawG4SLc5YblUkhkdN2f3bshyj2PibDWW0+nUJMYLbZuW9fOVi1aXv X-Received: by 2002:a05:6a00:24c2:b0:4f7:282c:4397 with SMTP id d2-20020a056a0024c200b004f7282c4397mr12034046pfv.78.1648241538720; Fri, 25 Mar 2022 13:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648241538; cv=none; d=google.com; s=arc-20160816; b=bdZFjHwwf2AqpQDgnsOxmZoCTucIFAJDNustzvL4f456+EMFfgV+oiwxVFD5/3rS4K RtLh0CHNslM+RJNPGgOQWUxYpVlhtaVqBKE+Nf6IB3NM3MgUVcdEqCeUYfNCqxJuWP9/ wDDy5D21bb5e9Yt+JFS+URlk1hJ3Kub0j66OJjr6VZ2sWlbpUeoOwvMkBDDdVoEL8HLs K4XAxMk95gvJn1ZD3Zjkzh75oa2XDKBVPcGmbJFj/4HVjgOxXMBXwWYBPnTSvXhs+TFO SzvAfFI/zo4q9nd9kll7RwUiMZgKObLsoLktk+HYUYpXv6ceoStffCC+9Rws/pUGxaUk q2xw== 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=b5wJQQ7YqCa3aFhJqIL39US+IJSbvv4VXqtaGEmA6ik=; b=qrUT82KmB5eizWM1Jl3IxENagYS/UDtXb7o+cdr1DR77X7LCJH+oWo/8XSNuYcg3YW iZ2LvJFvfmX8DQXwCQ88mwTqkV6wwNz+jlFRq0DWvUFzxeXS6l9ynGsSFAhNZRkDazFX mcnG+k3DNruZ8p6eam3AuPk5LzmqLaSvBCH8OBYS6EYUF1idDDm7k11yPiA0Q19Wx0qb pJsAI0FPtD+S1RP7C9mzSa82RicyXCp1DNRkR+P1sAE9OUNpC6EoKI1bw6A2UdNxkfX1 Zyei0Fefi4tLnuPvEGVuZDB7aQ1ptp+u2w4t55fEGRcZuxLbUAYhQRBVYDvszO5aHRQw gvVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=CXFnQ8Ec; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id 29-20020a63185d000000b003816043ee55si3435002pgy.74.2022.03.25.13.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:52:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=CXFnQ8Ec; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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 84EFE606CB; Fri, 25 Mar 2022 13:21:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbiCYUXD (ORCPT + 70 others); Fri, 25 Mar 2022 16:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbiCYUXC (ORCPT ); Fri, 25 Mar 2022 16:23:02 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1480C5DA69; Fri, 25 Mar 2022 13:21:24 -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=b5wJQQ7YqCa3aFhJqIL39US+IJSbvv4VXqtaGEmA6ik=; t=1648239685; x=1649449285; b=CXFnQ8EcqIPxkIZDl6uyj8xPm1TCgANxFC5vmJMRmEWlEim zD7Mp0BhY9R79BpE9noxVMnq12N/vFVsqQXQqll877EK9buQnWPJg4I+qkO8n/wRxkBcUt29e+ttQ DOpMvboK5z2JSvdTqjAcEgrjJ21naFa75Y8Yg+162bhOhHlmW1/YTFtV1JrjWKiqx5Q8pEL9xXZKz HzofRBD+2TlvuyhuTXK5EQiTbqPXh7YAzcgA9RrsngnWvAb/S1HTx4YQngVHNQFGQkmIR5ZgmcBS9 Crpq8b79thPjsJEOS8DGPiEqqdxNubU1eyVgR7XfILisUl3W6I0jISQzm1yyGpvw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nXqQq-000UKo-TY; Fri, 25 Mar 2022 21:21:12 +0100 Message-ID: Subject: Re: [BUG] deadlock in nl80211_vendor_cmd From: Johannes Berg To: William McVicker Cc: Jakub Kicinski , linux-wireless@vger.kernel.org, Marek Szyprowski , Kalle Valo , "David S. Miller" , netdev@vger.kernel.org, Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , kernel-team@android.com, Paolo Abeni Date: Fri, 25 Mar 2022 21:21:11 +0100 In-Reply-To: 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> 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: 8bit 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 18:08 +0000, William McVicker wrote: > > I'm able to reproduce this issue pretty easily with a Pixel 6 when I add > support to allow vendor commands to request for the RTNL.  > Hm, wait, which of the two issues? > For this case, I just > delay unlocking the RTNL until nl80211_vendor_cmds() at which point I check the > flags to see if I should unlock before calling doit(). That allows me to run my > tests again and hit this issue. I imagine that I could hit this issue without > any changes if I re-work my vendor ops to not need the RTNL. What are the vendor ops doing though? If they're actually unregistering a netdev - which I believe you mentioned earlier - then that's quite clearly going to cause an issue, if you unlock RTNL while the wiphy mutex is still held. If not, then I don't see right now how you'd be able to trigger any issue here at all. The original issue - that you rtnl_lock() yourself while the wiphy mutex is held - can't happen anymore with your rework I guess. johannes