From mboxrd@z Thu Jan 1 00:00:00 1970 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 45666222576; Mon, 23 Jun 2025 22:09:58 +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=1750716598; cv=none; b=sIVz9PuYIrA1EVHLqQ21qkLaXIDDOtYp6daXK1nrv0/VZLACxLiEtbGukiSOF/J1+ObaeNYXdMxe7M8wqZWpW5XRMHd0tHHeat/OfrnyC54wCcShhjZlY9ysrdYDN/TT7rKtC2TRyR8lzenJp34PEw4n5JbB1WVNzOouzQ7+9rM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716598; c=relaxed/simple; bh=5frQLmnejkwYjByx8+w/jd5bNtqIW/nJ/GonxwhSADs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jByunL9DJ8RiklvUuDYC+rxwDNfSXhlE+YaFUaTZqKW4YR5fADSwo8miUI2T364eFR6pS4VgX/mQ9NzL3aVTrmjkQEa63qCQ9g3PtjEqaJ+Kf2xiiaMtusOGgTGjR0v2BLAb/++PqUqCkqZXNltM1/4HUepIxKd02sSFAPkP7Ps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GxVg751k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GxVg751k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2E32C4CEF1; Mon, 23 Jun 2025 22:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750716598; bh=5frQLmnejkwYjByx8+w/jd5bNtqIW/nJ/GonxwhSADs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GxVg751kfg+bZcOzFj5G9uZH2OUVgoLFmZwadOeujqop3MPUjZmNSF/klqWFzHKcm RxLEbLyUUthZMXIZXtA0Oer+7TVgp8qM7dm1W2KCGGax4hyOHxSJTqX0zZjVKgZues H/4axgSjfZ4a1jJfOmOoj2m0Tu4MqjDvaNKVDme8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kyungwook Boo , Przemek Kitszel , Simon Horman , Aleksandr Loktionov , Tony Nguyen , Sasha Levin , Rinitha S Subject: [PATCH 6.12 268/414] i40e: fix MMIO write access to an invalid page in i40e_clear_hw Date: Mon, 23 Jun 2025 15:06:45 +0200 Message-ID: <20250623130648.731133336@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130642.015559452@linuxfoundation.org> References: <20250623130642.015559452@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kyungwook Boo [ Upstream commit 015bac5daca978448f2671478c553ce1f300c21e ] When the device sends a specific input, an integer underflow can occur, leading to MMIO write access to an invalid page. Prevent the integer underflow by changing the type of related variables. Signed-off-by: Kyungwook Boo Link: https://lore.kernel.org/lkml/ffc91764-1142-4ba2-91b6-8c773f6f7095@gmail.com/T/ Reviewed-by: Przemek Kitszel Reviewed-by: Simon Horman Reviewed-by: Aleksandr Loktionov Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index e8031f1a9b4fc..2f5a850148676 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -817,10 +817,11 @@ int i40e_pf_reset(struct i40e_hw *hw) void i40e_clear_hw(struct i40e_hw *hw) { u32 num_queues, base_queue; - u32 num_pf_int; - u32 num_vf_int; + s32 num_pf_int; + s32 num_vf_int; u32 num_vfs; - u32 i, j; + s32 i; + u32 j; u32 val; u32 eol = 0x7ff; -- 2.39.5