Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5777766pxb; Tue, 16 Feb 2021 07:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ4A2dfg3hxqRgB5Xph4GMx0onCk6SP7JNRBkKvN1lWicUXTeBCud1DwHQx76GKmRDGrR3 X-Received: by 2002:a17:906:c1d9:: with SMTP id bw25mr20696624ejb.452.1613489046376; Tue, 16 Feb 2021 07:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613489046; cv=none; d=google.com; s=arc-20160816; b=j/8bD6Ax/yXj3jVnTGrJpwJAknA2RKto//Phj+MbpZx9xDrwPRVzAFcdQjyzw/Hqt7 XMx/2xO3HlLC+v3Go8UeCEgdbx7AJuvSSnHZVBshG3zrussyGKS0eqxli1kfEZNg3y1p dJmxw3MNOK8GaML2BQZ6y6hmu2OFKgTSA+a4Qw76upm5m+V19tYeLRhWPLL4DMXkCW70 bpAtrLQnWLy+0fyMWWp12GsCmWBHXadjLw99PjrPtI+cEPwO1Q8F5JKl7bzL8AxIt7Cm zhbbq7KZh3lzasDUUgj55YB6EDJ+qvND1R5QRO93nGzQSR7hZADAiLj2L/3o+tkGF2Ru ds3g== 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=SCrgrLSKV5HQB6OBnUPMDNWqngKo2XMqSrnq8eY6WsA=; b=KiLIL5r1N8JTRdsV71Y8ZQ9bBuDEwoWjKjP50p9yO133p9iFYiynGfM2Ql0nBBy/P7 /hlMScgeYLujdNnseTJBB4Yn0pXjT3dfYb6VxjNxgSXEX9w3SpSE7cZuBMYpCMmzDux6 v9qYVk2noiYqP+xOSE4SFEXCFfqCPlffZLxSu4bjv0BgyKp8XNxcdCIHIDEKHLFBg34U DgNuZhTU0RW626jWdDCOrh37J/hygy4CJhf8aaX7/jx5K4s2PJgpNSI5vOKvqJVXTcuS jMrQs9C9rGDpt4Yfmn1ijtF98/ZUI+LLWoKDJjQTieGSDdTVAV9JTWUNxlVSRd+YZecT bdtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ajjegBvT; 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 i10si16441641ejd.325.2021.02.16.07.23.19; Tue, 16 Feb 2021 07:24:06 -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=ajjegBvT; 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 S229927AbhBPPWw (ORCPT + 99 others); Tue, 16 Feb 2021 10:22:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbhBPPWt (ORCPT ); Tue, 16 Feb 2021 10:22:49 -0500 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4CB9C061574 for ; Tue, 16 Feb 2021 07:22:09 -0800 (PST) Received: by mail-il1-x12c.google.com with SMTP id a16so8571221ilq.5 for ; Tue, 16 Feb 2021 07:22:09 -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=SCrgrLSKV5HQB6OBnUPMDNWqngKo2XMqSrnq8eY6WsA=; b=ajjegBvT4OQM+IdOuLpL2uld2MxN/oDN6kZGeQJ6jVE0ibi30A0gcI4qbR9hT+SZCM 5xoSEvrsss7NQehq3M+FqsXtU8DQ0gdGxQkulre0qG0YTQMb0HgQXAykzpEb+D7K5m5S UpDkHHhPyzJyEjDFP0lQRO3TDLGDiqmaU9Rpc= 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=SCrgrLSKV5HQB6OBnUPMDNWqngKo2XMqSrnq8eY6WsA=; b=fYK3Q/su186X4rYPPiXZ48bI0R+0IKW5MYJP1Ub76HO3rXqQJzyXJp48zoMZUotexV HFFn8/O/0a9lIctdPNrUZfuQsWcfS2osYIaEy5TCIF6dUHkcfRLMJQf5zxfguH0Z8Ocx 6MhuDpyAWLrGwF9Mos7c2glfNWD2DXMBQhaQIbOop12ERSFinSqtMY+NDcIAGjGOGV2f 6MkbPLhUqg0d+xJz9BLjxP6jGrTXhUewDKGvJNIhH3JbEqVKYUOqEMrXr8th5UxmJ5kS MQdQmQSVUGf9ddZCrGyFMgpJjapV003UVYz8oP96nQyRsyBfeSEkOdE6HH4WPTY9vufW zuNA== X-Gm-Message-State: AOAM531lrmBhNIjitX43zvBiovTPhWI0xV4ydAWX7z4LO2ZgNO0mu0w4 cRMa26JVsmqFyPRFT2+M0oMTbA== X-Received: by 2002:a92:d691:: with SMTP id p17mr16842092iln.135.1613488929142; Tue, 16 Feb 2021 07:22:09 -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 i4sm10577363ioa.30.2021.02.16.07.22.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Feb 2021 07:22:08 -0800 (PST) Subject: Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference To: Felix Fietkau , Kalle Valo Cc: davem@davemloft.net, kuba@kernel.org, ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <43ed9abb9e8d7112f3cc168c2f8c489e253635ba.1613090339.git.skhan@linuxfoundation.org> <20210216070336.D138BC43463@smtp.codeaurora.org> <0fd9a538-e269-e10e-a7f9-02d4c5848420@nbd.name> From: Shuah Khan Message-ID: Date: Tue, 16 Feb 2021 08:22:07 -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: <0fd9a538-e269-e10e-a7f9-02d4c5848420@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/16/21 12:53 AM, Felix Fietkau wrote: > > On 2021-02-16 08:03, Kalle Valo wrote: >> Shuah Khan wrote: >> >>> ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() >>> return pointer (sta) outside null check. Fix it by moving the code >>> block under the null check. >>> >>> 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 >>> Signed-off-by: Kalle Valo >> >> Patch applied to ath-next branch of ath.git, thanks. >> >> a56c14bb21b2 ath9k: fix ath_tx_process_buffer() potential null ptr dereference > I just took another look at this patch, and it is completely bogus. > Not only does the stated reason not make any sense (sta is simply passed > to other functions, not dereferenced without checks), but this also > introduces a horrible memory leak by skipping buffer completion if sta > is NULL. > Please drop it, the code is fine as-is. > A comment describing what you said here might be a good addition to this comment block though. thanks, -- Shuah