From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25EB5C433E0 for ; Tue, 16 Mar 2021 20:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1DA864F83 for ; Tue, 16 Mar 2021 20:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbhCPUdC (ORCPT ); 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