Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6530437pxb; Wed, 17 Feb 2021 06:59:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy67tTK3+IZ+7WbKQdZECchv+PTVs9CgI7ZXv5oC6VMdXkV9QyKgdJRscjgavLFrl7bScNR X-Received: by 2002:aa7:c84b:: with SMTP id g11mr26613656edt.169.1613573997804; Wed, 17 Feb 2021 06:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613573997; cv=none; d=google.com; s=arc-20160816; b=UcUApLVyMQ++PSXXX+q3cmqR5+BIVEA5vBfeF4BJfY08h5OxEdEGww4ucACZoTzcWi +WKKUgTU3dEwyGtFe4+pIaap3h3Tqvpg/ngILyxiejbmlGzMlbnW1a22SW00c0pvl+ZV skT10nO+hS87lE8m2FU3d8XJrnwTvft09bvLBuGod1h+xZunN+KF9OIRkAZIf91JqD0w /zAvJByB18GSJ+fg+F/uNfLzhtV3b2O7izHeXFrfkWPz94DKe3zUSjHHFzMhDFDEgGKd bYadulfvRSen3LC72o2GbiuLDdxQtQwJirk6gUKpWZfOL/5CFIJGqZ3rjOANoKqDlxVN RqNg== 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=ydHdMTd4ps0AXeryEcGbvz8MsZ78eQIQNAjnZKZ5I+Q=; b=lNtAFkN2sBAWcSZ701HjFYxLMrfauX7p4vejlYxZzBRCT68eJFLP/9viJPNil/QOCG d6Vg0zZ2lF15pOi43pu7J8DYO2vgKS+r0z4CIXozr2RK/X+W5EQgosrxc6pbhI+2rOR7 0BqT96pkmj09M/U7ORCxLwBUVLdUSXEbogXECxCv6KHzqELEeghQk58q5wHvyk/c8Pdy Zg3aROIPVKIHlwK/Cgu/i/QejhtSneAx5WzpzsBu6J8lOhOx2x+2eNQ9+QzPr5UxWoqm VOP3kzzAmTcTAm0b3pd0FUKdX2/O2st/8GNOPNM6SC2z+Pfx8ixwzTsWm9yB4gGetdjw XzqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=QArniZnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 qx15si1578201ejb.25.2021.02.17.06.59.23; Wed, 17 Feb 2021 06:59:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=QArniZnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S233632AbhBQO5k (ORCPT + 99 others); Wed, 17 Feb 2021 09:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233381AbhBQO5h (ORCPT ); Wed, 17 Feb 2021 09:57:37 -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 52CCDC061756 for ; Wed, 17 Feb 2021 06:56:57 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id o15so11500300ilt.6 for ; Wed, 17 Feb 2021 06:56:57 -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=ydHdMTd4ps0AXeryEcGbvz8MsZ78eQIQNAjnZKZ5I+Q=; b=QArniZnH1HDN6XbvShuegQf8ATVhoFhQM5Sx7rfRv8KxefFdxWqqxZXVJJRewt1t9B ui/nmcdNhusE232TDbipsbl7LSrJ2CDBYSH+/tbcHgCtWSljTZ8gAKTsF6RvKJJUI3SV Sz1RjjI5qqmQw+u5ReOCNewVDaMRHDst8qXHo= 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=ydHdMTd4ps0AXeryEcGbvz8MsZ78eQIQNAjnZKZ5I+Q=; b=rl4w2CyfS/sU0nqdHaQWtEHjfdeOaKnLLM6Y6f2YtqJdjUqFzIDebQcI4sJjCBtrGh lc2ZXOWCOSr1TShIjs9xiBUIvw74c/QKTOuV1kITTQgD5nGJNNO6IWyZ4OCZBs2f5Saj 7TQkZ69m8DkGaGKMWo4ATWHpgKXRMFSoY0qNQdqIbIkUfZJFgVGKnSOmHt1NAnthQLjK rtSQiO9xgtvUbWd6IX46bfEwZHSUefpLbX18XIC1zQwjApIpp77Jm1NrmedUmcUR5o4w Y+N7hD9zz17aOpRvRkixW5fSpQI0BfBuP26i4ni3eSLrbzWk1Qb910Rh61310OTSp6b3 ym8g== X-Gm-Message-State: AOAM531Lk6dcJCusHXNVU4cu2hBmCSkjHxLkyYml4DIbgq634IiLf+Pe XsjZOe3GXrNYjYz7Kq85BEMI7Q== X-Received: by 2002:a92:8557:: with SMTP id f84mr21452757ilh.4.1613573816719; Wed, 17 Feb 2021 06:56:56 -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 n23sm1415589iog.3.2021.02.17.06.56.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Feb 2021 06:56:56 -0800 (PST) Subject: Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference To: Kalle Valo Cc: Felix Fietkau , 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> <878s7nqhg0.fsf@codeaurora.org> From: Shuah Khan Message-ID: <6bbeb37f-620e-d92d-d042-a507bbb39808@linuxfoundation.org> Date: Wed, 17 Feb 2021 07:56:55 -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: <878s7nqhg0.fsf@codeaurora.org> 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-kernel@vger.kernel.org On 2/17/21 12:30 AM, Kalle Valo wrote: > Shuah Khan writes: > >> 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. > > Shuah, can you send a followup patch which reverts your change and adds > the comment? I try to avoid rebasing my trees. > I can do that. thanks, -- Shuah