Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6281847pxb; Tue, 16 Feb 2021 23:39:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdUYm/JQBJnIyWti+ChBaDwEPqhX5oe1BrHpi84Qt01yKEUXWTZmeOAQslbzVMky/q8Vcm X-Received: by 2002:a17:906:43d7:: with SMTP id j23mr24151576ejn.519.1613547543341; Tue, 16 Feb 2021 23:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613547543; cv=none; d=google.com; s=arc-20160816; b=iePg7wmbnOT+VAQuOBIN6/RMAnrDe3FppgcTUIjEoUIzh1DqoB+39i7b2mYq6T1DNr N8nLcXAB6oNuZ0jnsJ8nx9LoHS7y/HUB2RBngIdFUOoFEOvxQBYCuJ9ZaKInr+7QyswV 9O8QUuk94lMmt3aEc9jRIK4bhN4si1GP7mI+m0XcTPEJJCkC5+M5mJ4eg7ZLe8evzzwG YD5+9/LfaEiD4YuEVh+ePgK9v6WanK5lS9Y5k47GAqxlaW2YOLP/h0XQc57Ex6wUFojN u6FC+jXwXqoE9ydiwz5XbejK05UArXnxdqKZN//fprr15rCGXKfCDgBvccRDbgXu0sDQ 2maw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=VdTuFW1eZ3KIE8WTPHjDwu+M4861ybBJaxdd7BYbVgs=; b=nnyoP6BBfgJSrXQ3OfHZhLAN5X93GsFsDMzHdG5NVhX+lA1RGaZDaT45cJRrDB78Q3 eMMo1LQcAb8bdYL1ClJCBYIk3vMeunN+6dLzIHxsojXqChY7wK3uqxw2ci30BwOjkhcz YTnCffsLNe0c0G4QF+bf7XjlJ456jS2ixRXIR9gLLgOG9yisK6t2Q4xcKVIvpwf8F15T HPDSZdSBL3YD0z/cQeXBo7tUP15IGyKufSYI0YOOL0iOwzf9JBU7JtsTfa8PMw7LlEWY 0YlbLxjypwgMIanOZZO6DGUFx7SgAPcOYeeI6nWGPXGbZzXfQ22R04aBEtKYcOXFcmBK tpgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=BydtRVbz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj13si1036558ejb.610.2021.02.16.23.38.40; Tue, 16 Feb 2021 23:39:03 -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=@mg.codeaurora.org header.s=smtp header.b=BydtRVbz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbhBQHbx (ORCPT + 99 others); Wed, 17 Feb 2021 02:31:53 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:62042 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbhBQHbu (ORCPT ); Wed, 17 Feb 2021 02:31:50 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1613547092; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=VdTuFW1eZ3KIE8WTPHjDwu+M4861ybBJaxdd7BYbVgs=; b=BydtRVbzBi1+qmxaOxe0luP+DsQe4M8cBma/zF9QEkClyXKI+FneJU5+wlVxi1kslWReX2pv 0TJub4O5qAuln08F7Dt15szd2RsxGx99cHUi32B2sOkQFaMoL++t2CNAOpMwWp6KPrzQFeZ2 6XzqHTrrF5SsX9unryMfKWM81aU= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 602cc6350b8eba4b52b50f1f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 17 Feb 2021 07:31:01 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C6E75C43465; Wed, 17 Feb 2021 07:31:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id B0331C433CA; Wed, 17 Feb 2021 07:30:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B0331C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Shuah Khan 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 Subject: Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference References: <43ed9abb9e8d7112f3cc168c2f8c489e253635ba.1613090339.git.skhan@linuxfoundation.org> <20210216070336.D138BC43463@smtp.codeaurora.org> <0fd9a538-e269-e10e-a7f9-02d4c5848420@nbd.name> Date: Wed, 17 Feb 2021 09:30:55 +0200 In-Reply-To: (Shuah Khan's message of "Tue, 16 Feb 2021 08:22:07 -0700") Message-ID: <878s7nqhg0.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches