Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3110410pxb; Fri, 12 Feb 2021 09:22:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr6u/AZ7nJD4uGjoM9gXMU/Oz5FOzK1BMR34A/YyJKJXbMgDtZeJJ4TV5aY6Nhg3dHjU3c X-Received: by 2002:a50:9e01:: with SMTP id z1mr4451403ede.44.1613150573111; Fri, 12 Feb 2021 09:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613150573; cv=none; d=google.com; s=arc-20160816; b=bEkeczQPdK03o+f4OkNxt7izBu+jxuKP4o0zdIQH5VWh5Mk6OuCtXh2TbS7og7SCj3 4nl2T8TnC2O1r+RmTtfmDbVZdjPzqlZFnSDbL54LMLikwKXb7Ud+UEdNN0d9b5CWrJQc oOQ5IZWwsV0c+rsp7b0tbQEwBN/552zvRUA8o2W4qATJBb1x8U88uGX+OUYEmm5YISUZ 4Z/D1Y+TviWfYbgx3Co0PkoKUp1SliVWHhPgBfr3vcDYp8TBzqdPe9BO3Wk0UcskamjR UB9h0XqVAgYLra/234aK3zz+4w3YUl7V2eJaxeKkAkiAWt+k5zNh1yGbg0LmerENJL5X FEaQ== 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=n9DaPQNZ9ApDhbjk3lpcweLqgl0plvUaf017MPEDmY4=; b=Ra2uw76YSGINM8cHlIhLuPmPcJHdE88yOFYBfm/RQ3/3+dez2ruVZ4iuDkv20h8JH5 Mx+VtkDW2coT8DKihd2n9rf5vsnp/H+B4gSDg7sOo00KerWOxTPSwgpT6Nwye1aAysy1 60x/XdnrKCjwZmAhiEwy1m2DXCZJaI6QsnD33xCW4L4o0Tw8fqSx0rkPo0JvYmgvLuxj fzmdI/nYSs1FZw4Hnh300X+2c2yfXxDUBBGj9rZswluj4K0cx18Qnz6wqCowJm2Y9wG1 8YWMj+3S6WD94zEo1vzf7doj4uGMQS3i48OvZEspx6pXwcuC0SdTU+dyeO+FCOqibUvi 2W/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=bH7T+IP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si6916538edp.392.2021.02.12.09.22.01; Fri, 12 Feb 2021 09:22:53 -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=pass header.i=@linuxfoundation.org header.s=google header.b=bH7T+IP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbhBLRVO (ORCPT + 99 others); Fri, 12 Feb 2021 12:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbhBLRVK (ORCPT ); Fri, 12 Feb 2021 12:21:10 -0500 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01BDDC0613D6 for ; Fri, 12 Feb 2021 09:20:29 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id o15so7857124ilt.6 for ; Fri, 12 Feb 2021 09:20:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=n9DaPQNZ9ApDhbjk3lpcweLqgl0plvUaf017MPEDmY4=; b=bH7T+IP0hxSM4qnABSsyIGH8bQIX8SeAq5MeI+UJbArLYzuYwzj4s+w0R6hYaioIv3 5l8j7hmD5TJxLVvpuP9gkfBDhs+RBXF6Esk6LyXnY2p0jkIUh3NI6cZMM2GEBxLC7yHF wWvueSO5T3GxMWuJGZN82vxNXh9J8KLIu3LUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n9DaPQNZ9ApDhbjk3lpcweLqgl0plvUaf017MPEDmY4=; b=RzfFHNoFVOyUTjd4V2P3vd30J0wt+K8yeX8qUUYnBECfVM5B/gu7g9ttePgBvGJdiy 8qVCuUZfQlxiTDfBY5TyloC6dCBPBZeZgXFDQT9rl0ab6dpTR9LMpDF8Dkqb9Ndbms4q MZjn4T364ZdGbo7JJ3wTEOp0duC6Vda3m0mrt3s+SVFfCEvrANIBCSvI7JR/1EntJ4pM hztkZ9fidomn7hwQs6Q60yCn4i1jTyfwxrIDkVGAOyPr40/oayGvyJ8LlrbLf6qQnZS+ OT+IdUsZfDs6x3hBvKUM4rQUAFT0zv6iti0lBJqKOIi4w8J8kxkOoqj3F+ZmnFGdF9Cn UL0Q== X-Gm-Message-State: AOAM530Ox1p5QVPwLYeQRs4Je0bpdIphuENBepYwZ/dSs+YCh7qDdAgK SeUEnQZJeg8GsXYt2genge6SjQ== X-Received: by 2002:a92:b749:: with SMTP id c9mr2906435ilm.199.1613150429332; Fri, 12 Feb 2021 09:20:29 -0800 (PST) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id o131sm4632861ila.5.2021.02.12.09.20.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Feb 2021 09:20:28 -0800 (PST) Subject: Re: [PATCH] mt76: hold RCU lock when calling ieee80211_find_sta_by_ifaddr() To: Felix Fietkau , lorenzo.bianconi83@gmail.com, ryder.lee@mediatek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, matthias.bgg@gmail.com Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Shuah Khan References: <1cfa036227cfa9fdd04316c01e1d754f13a70d9e.1613090339.git.skhan@linuxfoundation.org> <20210212021312.40486-1-skhan@linuxfoundation.org> <3949e1fc-c050-73e0-d02f-63a25c4821ef@nbd.name> From: Shuah Khan Message-ID: <61994394-0d95-39eb-2a11-487ca7c6c37b@linuxfoundation.org> Date: Fri, 12 Feb 2021 10:20:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <3949e1fc-c050-73e0-d02f-63a25c4821ef@nbd.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2/11/21 10:36 PM, Felix Fietkau wrote: > > 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 mt76_check_sta() 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 > If I'm not mistaken, this patch is unnecessary. mt76_check_sta is only > called from mt76_rx_poll_complete, which itself is only called under RCU > lock. > Yes. You are right. I checked the caller of this routine and didn't go further up. :) thanks, -- Shuah