Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp356482rwr; Wed, 19 Apr 2023 07:25:53 -0700 (PDT) X-Google-Smtp-Source: AKy350bHcbrIfCljhMmu4Tx7ZLaHSF4k1fj0C9031cgtM8z0F7Gh6yotxTaJKxOoqzvyuLR8nTb4 X-Received: by 2002:a05:6a20:a110:b0:ef:8b50:56b7 with SMTP id q16-20020a056a20a11000b000ef8b5056b7mr4359547pzk.60.1681914353039; Wed, 19 Apr 2023 07:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681914353; cv=none; d=google.com; s=arc-20160816; b=dBEF4E3MtEyq9a1KedpeLNyB47rn5GKUn0JCBuXrTE+wN4YBOAsp9RA+pTkWjzotIL Qq/KjrmQ0cBkIxoRlu5Ic9WWqSzZCnQ8kNn1uh6yCLZFC71iUOQKniDRntwhOT0XC9P0 AdrrR0TQnIVxghCyzqjJLrFMYU4lbMuArhbcuPkX0yuR218DvtT2ky9ieUH7OzrDkoP6 pZnTGIk0dpY+ILnI9MpDU/2PPVr7656wNzdZFUUY5F9vGX1caYbmSIe8hkbkTRv5/c7q nTlqjs2R3OJVqaNCMwPv0jB0HMRI8QTbyUVDmdv8tbylPacSNA2qOEUHhZHTnGX4BaDG 7qbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=+YimW2JNf+oHOTU6g0dGHxx7f7fwQ/qeSqCPYYEt5/o=; b=UjKPPnyjrCM8bKaB34qYAnkDdhJhqMBECfuFB9xVsVKWYCsBi0jWo3DVCX7upyXgYx jBJrgsWfGuZJQORyrjb2Buw8IJRYWixjnIXV+QzgFuMbKo15HEvagCPQ1DRcz5oD1fYi 3NWGTf6AWbjS4q7yIpx5r+8gNCsMQqftaGaONLRRQ76EUG5aGgMUcY0lt9Ec5WeGiqye tdt2Rbv3erxLasDcIvshZOrEZFffYAPaKCTakHKkyzexPfJgnxKI20PeCnV29Jrh3AiW 4KOyu/RhubIPnEKgu8CO2Hi8Snm46rcKjLR1b7Mdkqj0DsbH5ZlBt950BGhPDZIPEV1c vhJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r56CNY2w; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a65480b000000b0051420373a5asi16148208pgs.679.2023.04.19.07.25.45; Wed, 19 Apr 2023 07:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r56CNY2w; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232351AbjDSOXm (ORCPT + 64 others); Wed, 19 Apr 2023 10:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233303AbjDSOXO (ORCPT ); Wed, 19 Apr 2023 10:23:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56084118ED for ; Wed, 19 Apr 2023 07:23:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CC75463AB7 for ; Wed, 19 Apr 2023 14:23:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25DA8C433EF; Wed, 19 Apr 2023 14:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681914180; bh=HAbRNwbjEx5nsjR3xWymJ4ejFkh2h+WBog4VXc/zlk8=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=r56CNY2wZUag8AyEI2WxriXna9jDYMdsjsmggvj1wkLPDK7hCStdOmJj/5JQoU5x/ +bIwC14g0/lHyedxKlJ79m8ViBgk5m419OTTrntCUM/Ujn5ITsuUPNDuKnvUzSj4up pywirmyPCtX9aD1qeNiR0SyU4IdnCY/f7T3sY3QrU3QEhqdlAAUb34+x4Fq6akpvJ2 QHtv/d/waHm5JN7WodU3WjRxPJ0Val7ln0Gn4qpBjVaDPUjLsFu62+08AgOu/vqrdJ G8p/+pnLyKoO8lDzx6Er4KEX5SRCpHDcaTFaBbWcmdzfFou3D/kGTM7p1SF0tpJCw4 mwP/rKel4Wg/w== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 1/3] wifi: ath11k: fix double free of peer rx_tid during reo cmd failure From: Kalle Valo In-Reply-To: <20230403182420.23375-2-quic_hprem@quicinc.com> References: <20230403182420.23375-2-quic_hprem@quicinc.com> To: Harshitha Prem Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, Harshitha Prem , Sathishkumar Muruganandam User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <168191417708.18451.17418807268052315291.kvalo@kernel.org> Date: Wed, 19 Apr 2023 14:22:58 +0000 (UTC) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Harshitha Prem wrote: > Peer rx_tid is locally copied thrice during peer_rx_tid_cleanup to > send REO_CMD_UPDATE_RX_QUEUE followed by REO_CMD_FLUSH_CACHE to flush > all aged REO descriptors from HW cache. > > When sending REO_CMD_FLUSH_CACHE fails, we do dma unmap of already > mapped rx_tid->vaddr and free it. This is not checked during > reo_cmd_list_cleanup() and dp_reo_cmd_free() before trying to free and > unmap again. > > Fix this by setting rx_tid->vaddr NULL in rx tid delete and also > wherever freeing it to check in reo_cmd_list_cleanup() and > reo_cmd_free() before trying to free again. > > Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 > Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 > > Signed-off-by: Sathishkumar Muruganandam > Signed-off-by: Harshitha Prem > Signed-off-by: Kalle Valo 3 patches applied to ath-next branch of ath.git, thanks. 93a91f40c25c wifi: ath11k: fix double free of peer rx_tid during reo cmd failure a8ae833657a4 wifi: ath11k: Prevent REO cmd failures 20487cc3ff36 wifi: ath11k: add peer mac information in failure cases -- https://patchwork.kernel.org/project/linux-wireless/patch/20230403182420.23375-2-quic_hprem@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches