Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2027554lqa; Tue, 30 Apr 2024 06:35:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhSOx8a81zDjurmfUTywxF+ybXMnIecn26SxZrbD8yDzL0QoAsqMuWoow8TuxBOKqMFX6L1Dy6bLdqqWq2qABwZ7dKp4bHHaCJoKBN5g== X-Google-Smtp-Source: AGHT+IFpz7Rfd3H+Bv8AlzXD2r85XfY4uMkCcAyHyvIdpu0We/3iD2CaEOGSesWfLKBbpiXtA6I2 X-Received: by 2002:a05:6214:cc6:b0:699:206c:2db1 with SMTP id 6-20020a0562140cc600b00699206c2db1mr17376702qvx.16.1714484114406; Tue, 30 Apr 2024 06:35:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714484114; cv=pass; d=google.com; s=arc-20160816; b=VeDXTtfEGWUbDd+7B1LmXKf4XjhBNV5R1AK4KWYWRHT0B2CgJHJkJ0woKcHW9uwv6A 21VCtNxoktVdWnkn61zTdad5RhI0tdMElL/pn9lW494d+rAnNb1SEGdFAXu771lkBBPQ uvABMbE4dGuEyZmcjsvTiA5JJKZ28VFnqEmQ5SbhW8999pX1uTo2Rqr9ir+lL4AeD8Le 75BWEw5/K65d62DnY8e5lZcPvMKULIzA9jDo9thjJsUbyBYI5KpR4xVLTa07vqN/sW6Z 0XnpDvD5wM8pWXNizhzOr+KLQUX7hUZAwqYmu5U0JfM2+/TaofiCXOeu4zKfXJuJKjxG t+Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=9JNa7sh2DzJRmBGvzfmVAzlW2PwZ2X/2DhlO7kkeyXE=; fh=q0pWxAdL0cyDcfHi0eFkTCBsBNeBmItsjEnoI8WnNeM=; b=dm3zYubRY9arzc42UJBAvSTX9MOcxJgDK1XO+/j8Y4KIy1uiXXkKippmyospffzSIv genYkUkEMoj8bx31YQCfN+VpWUUqxhcuBbf+8UZZMknOcWzsj3V56X6azeSqNOcm+50c zsRD0e0dDO1EwrrkLsLfW+/bFIoB6nmI7qr9ODleff+OeovUsUSeSSTtPSC+8XopZi3n 4fSKuswdC40Y6Q9IDJUt1mKsmVu8/QsVgpibnV9hiRUzEXj/8MWIvPUiTPpbQKMWkH1p Tk2W+rKOdAAMmiwsC6QWnraDnVwiVGUO9/SGqH1Cnk0WmU0d56xuv+fhIE5I0n55afba fkRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OAqdjBUk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u15-20020ad45aaf000000b006a0cd228d88si5165494qvg.499.2024.04.30.06.35.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:35:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OAqdjBUk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EE1161C223E1 for ; Tue, 30 Apr 2024 13:35:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F129171E6E; Tue, 30 Apr 2024 13:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OAqdjBUk" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08559171E66 for ; Tue, 30 Apr 2024 13:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484054; cv=none; b=Hcke7Pqy9jTxZp4VOdenPEiIEV/Sq28K5Ix5YaLKwAshRlNLw2+HD7ZQuZTSiWeA1H8ePU/AT07KQhEqzQVqqFpuTkWc17fz1Uga7yDlPEeoSAgm3ABh8JskfCtTDpFQdd+cyb0k6sUFiMF8NZkeYLs0TSiGgJFopiefzgKAMEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484054; c=relaxed/simple; bh=wzkgOC/aglpW7s76rCyOHqSnMmdZuP+WCPsYrPnKeCI=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=abA10PgJsj3tGom2UIsfnHh3YNpQeBSFuJxAJm9Sl1ztsOTvrgZ3MwfI1yYlSZJiAPhGuun/I2EwaAGWGYKnrlyXKaajQfd/VJOAvbBerZQaT5AQlz0SmxLegxGjvCWVORTYYgck7ra62y3H2p1c80cnb9pReVTMrbEbxJRgy7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OAqdjBUk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFF01C2BBFC; Tue, 30 Apr 2024 13:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714484053; bh=wzkgOC/aglpW7s76rCyOHqSnMmdZuP+WCPsYrPnKeCI=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=OAqdjBUkiwsyC1dBNip2NOKXIgcstY8Ih155Gn0+4H5UJa/jTkD+/b2g6q5NJk7kO mK/1s4bZV1gdIe0bHLhRl3sR13y8Gmrol5uAiLWfcMIfIXftAW/QoVR2CZ3J56QaXR mSlbksess+JMZvgJnGBgAaYFtAcWbk8WfjxJT5d/hY5anqkIDNBvzIqYJ5QcgUldho DKYwvDbi4xEM5iWcH7+fyoBeq5o7YMA9zp9HUg3X334KqV4Sr2NcjnuQhGAHbJgIuJ LiQjhd2AeteON3Sk5rLKJmx5WpFU6p8d7S2TTYChCGOGrkLTwB/j63crv7uIj7hHb7 3/Fm4fLRrD/jw== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: ath12k: check M3 buffer size as well whey trying to reuse it From: Kalle Valo In-Reply-To: <20240425021740.29221-1-quic_bqiang@quicinc.com> References: <20240425021740.29221-1-quic_bqiang@quicinc.com> To: Baochen Qiang Cc: , , User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <171448405111.313333.6267220944906708635.kvalo@kernel.org> Date: Tue, 30 Apr 2024 13:34:12 +0000 (UTC) Baochen Qiang wrote: > Currently in recovery/resume cases, we do not free M3 buffer but > instead will reuse it. This is done by checking m3_mem->vaddr: if it > is not NULL we believe M3 buffer is ready and go ahead to reuse it. > > Note that m3_mem->size is not checked. This is safe for now because > currently M3 reuse logic only gets executed in recovery/resume cases > and the size keeps unchanged in either of them. > > However ideally the size should be checked as well, to make the code > safer. So add the check there. Now if that check fails, free old M3 > buffer and reallocate a new one. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 > > Fixes: 303c017821d8 ("wifi: ath12k: fix kernel crash during resume") > Signed-off-by: Baochen Qiang > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 05090ae82f44 wifi: ath12k: check M3 buffer size as well whey trying to reuse it -- https://patchwork.kernel.org/project/linux-wireless/patch/20240425021740.29221-1-quic_bqiang@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches