Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4467771pxf; Tue, 16 Mar 2021 14:26:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyNr9HUmELA/oPCwSt1GtcOfwybIqKXDgRDKhzAE3OHSKMpNjfbq5noYDAuSmVl9/JMvnz X-Received: by 2002:a17:906:b316:: with SMTP id n22mr30943608ejz.249.1615929992081; Tue, 16 Mar 2021 14:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615929992; cv=none; d=google.com; s=arc-20160816; b=c/8GetnOnLNZkDaHvBex5rnzlZuxotOPgaOd2Q7SNnIVgI6Anl/4ueEoiG/QCSQ9FA ZlpuNJ7Ao7pvrHffVnruqgh2z0Fi4ELEMkvPrNVv8DmkLsWbpRY7tMSM3Q8Hp6p5b9ea fQcWudJg7r2uXMNTfb8knhC82cftXByn4KeCYZu5sU8qTslMubkGoABExvzLI1Jq5jhw qj54GZbtqw7J8twv+rZUDm+/W24LuPPPv6DqR3a4J4H1P9BNwhfS7z6w+ZQ/RUIJWi4E gvIPUQUXoaTP6GpBdrCDi+qgg5AwN7jbthBXGCwdYmOScw4ieDcw1kx1IgF2h6uZG49M 9wUQ== 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; bh=up9+fjPbB3WdgjB2UJ+IdEuCANim/WjmBOzSn0a8CAU=; b=kpcduyOU40ZMhwTuyPQfkDZ1//0iGN88BP3YNByJwAlE3GfrYyXRiogNqzYqq8npvD CXTW2fr4x/ZkFnTRE/9SI6v/0wfUnaGGcZAxdP0DWULmUzG+TAdWr5fiNfGgGgAoYOsF mf5IWP5uiXXEd92skn3jnlVFIsK0nOjbKjKg07LeY8B0VoGSsDmKdfSmrAbrpZvgQlwD b5yqTUDT8hrXrDq528b32IpYiQcN25Gg7o3z67p1IcUFDyaX1uet/CN3KvMveotpiTvq KmNGJb+W0k1JksOa1CKL7VOv8p2z4Am9U0cBmyTIA1k9g0JUL/OEqaeVBogbMfSAqBiW PCBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy16si8344432edb.105.2021.03.16.14.26.10; Tue, 16 Mar 2021 14:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbhCPUdC (ORCPT + 99 others); Tue, 16 Mar 2021 16:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbhCPUce (ORCPT ); Tue, 16 Mar 2021 16:32:34 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 994F5C06174A; Tue, 16 Mar 2021 13:32:33 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lMGMb-00H4jl-H3; Tue, 16 Mar 2021 21:32:25 +0100 Message-ID: <8a5845b49b6dc03b8d6f8fe9915034178be992ae.camel@sipsolutions.net> Subject: Re: [PATCH] net: wireless: search and hold bss in cfg80211_connect_done From: Johannes Berg To: Abhishek Kumar Cc: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, briannorris@chromium.org, linux-wireless@vger.kernel.org Date: Tue, 16 Mar 2021 21:32:24 +0100 In-Reply-To: <20210316192919.1.I26d48d8a4d06ef9bd2b57f857c58ae681cc33783@changeid> (sfid-20210316_203101_193722_2D56E503) References: <20210316192919.1.I26d48d8a4d06ef9bd2b57f857c58ae681cc33783@changeid> (sfid-20210316_203101_193722_2D56E503) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2021-03-16 at 19:29 +0000, Abhishek Kumar wrote: > If BSS instance is not provided in __cfg80211_connect_result then > a get bss is performed. This can return NULL if the BSS for the > given SSID is expired due to delayed scheduling of connect result event > in rdev->event_work. This can cause WARN_ON(!cr->bss) in > __cfg80211_connect_result to be triggered and cause cascading > failures. To mitigate this, initiate a get bss call in > cfg80211_connect_done itself and hold it to ensure that the BSS > instance does not get expired. I'm not sure I see the value in this. You're basically picking a slightly earlier point in time where cfg80211 might know about the BSS entry still, so you're really just making the problem window a few microseconds or perhaps milliseconds (whatever ends up being the worker delay) shorter. Compared to the 30s entry lifetime, that's nothing. So what's the point? Please fix the driver instead to actually hold on to it and report it back. johannes