Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2724445pxb; Thu, 11 Feb 2021 22:36:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOiBUSQgG+Z2IpCENr/4kJcY4NjDkYSQuistTLQdTTffafqnAvLBS5J11sR07Qm9X9nyp2 X-Received: by 2002:a17:906:2bc2:: with SMTP id n2mr1451380ejg.381.1613111815983; Thu, 11 Feb 2021 22:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613111815; cv=none; d=google.com; s=arc-20160816; b=uSB8sjGmdCsyKbMesNOqiocLKoGWC5ObQYm3tZ5wriI2/eZrJAi7PNVAtVxvA8ksrc IczquHSUQfOPolrY/dZmLlZnEvXmIfhAYaV2HmkKxuo+v4rC3EhYNsfA/T31U0MCdkgO mqqZnTq61az2a4GRB2Uqgi/Gx3SlfJhRJofC2zKTnc90ZpEciDbPbDxIx9SKjotYWuiK Lb9Rs/ouoHb1jKBmCRTX2vv2OMr01PEfZDUrDfyjBHZ4w9q8zBJZOCRbCbIMaf8/aiEl qhoFJ4lZM1NflIDFuYHL6SpFp/v5YkRVfgi0XzG1cw87li4Ml5M+accDFTJQw3ApdjEk ak0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=6ftLOQ6D9eeTaacotfOfS301dOzMiHhQ41LAP3tXfqA=; b=VQUoW8qRAALzNVbbiYaUVGPTkAJl8h0guhCYfQwWcVuaIqqb+rSIxv73iTm5W0IDyS 1n5rSsVbTyjmuwDboP/vqB8h43n7kYFzVLE+ejbtGR64ADZKTmZx85IPLlXScMyNbgIl d7wQx3C78oL86tw4vXUXF05hAWp3RDOdCT8wOhlFpbZjBhGJs5w9CbQ3sXpdN6HW4an+ 7zRyvFjfqwuD9xPIEIyIjNfEmRSajaZ4bFPBGFi9AVqHIWoJK1Hw2PhbntY8eG7w4pFZ nM+N0nn7j18JPj0mLH6mDgqjDpI5Qc3ZffU8IHzPuMzSxP0jqmarmHHezIjpsV2yahsL 1OXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=hEEDrY7d; 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 d24si5613833edv.303.2021.02.11.22.36.32; Thu, 11 Feb 2021 22:36:55 -0800 (PST) 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; dkim=fail header.i=@nbd.name header.s=20160729 header.b=hEEDrY7d; 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 S229837AbhBLGf2 (ORCPT + 99 others); Fri, 12 Feb 2021 01:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhBLGf0 (ORCPT ); Fri, 12 Feb 2021 01:35:26 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD27C061574; Thu, 11 Feb 2021 22:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6ftLOQ6D9eeTaacotfOfS301dOzMiHhQ41LAP3tXfqA=; b=hEEDrY7d68IWQPnW1CpgiF/8bp GIyvCqmdVEwykZ+/ZPOzyoRU5eqSljhl2vJAyoZGMQ9QC17f4X2fmyL++x5izTQNrGB/eJXp6NKMV gKe2t7WdIOqCT0eXoU/KN297KijKdT/QLIEEa/TkAj7ggZmbuHGXa8/JV4cg1epK9zbU=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lAS2P-0006tK-4n; Fri, 12 Feb 2021 07:34:45 +0100 Subject: Re: [PATCH] rtw88: hold RCU lock when calling ieee80211_find_sta_by_ifaddr() To: Shuah Khan , tony0620emma@gmail.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1cfa036227cfa9fdd04316c01e1d754f13a70d9e.1613090339.git.skhan@linuxfoundation.org> <20210212021312.40486-2-skhan@linuxfoundation.org> From: Felix Fietkau Message-ID: <0dfbd38e-6158-4162-cbd6-90e89728860e@nbd.name> Date: Fri, 12 Feb 2021 07:34:44 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210212021312.40486-2-skhan@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-02-12 03:13, Shuah Khan wrote: > ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and > the resulting pointer is only valid under RCU lock as well. > > Fix rtw_rx_addr_match_iter() to hold RCU read lock before it calls > ieee80211_find_sta_by_ifaddr() and release it when the resulting > pointer is no longer needed. > > This problem was found while reviewing code to debug RCU warn from > ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit > of other callers of ieee80211_find_sta_by_ifaddr() that don't hold > RCU read lock. > > Signed-off-by: Shuah Khan This one also seems unnecessary. rtw_rx_addr_match_iter is called by ieee80211_iterate_active_interfaces_atomic, which acquires the RCU read lock before calling it. - Felix