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 2CD1819D084; Mon, 23 Jun 2025 21:40:24 +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=1750714824; cv=none; b=KHqZwGrnSnKC+XXEFbB/3jf1sNJfNHge2KjTtO9Bd/Rzms/CyUqJrRaEuDMtgCEKoqu19oDtoXR95IFcEB02LuVOylYZ0MankOux3ox+GeBc/WDRNsw8SF1/z6yZwZs8nWp6LlEcGg1cnBqxRmcKMDemfv/WaGxpkmyzaGEuewM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714824; c=relaxed/simple; bh=qECiqUSZ7hN7zS7wTTnTp7qeXjGT/Y7o9+a44kAlSzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bgu/THSfBRN5eOZ0ozMW/x007TfhmrfM86uShbssmZ40jHVIFRM0T7WVhyYTq3QWwHkUv/Q1EaR+Vi0FZO3udBqqQZSpdTW6ohiwcqYwixli8WB9er0Nt+QEfUwqwuh4hCbPSTsLEDEw7f4CX8urpKhOmbeNNseU6iMGG1RJ2GE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PfIB8TKS; 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="PfIB8TKS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B945DC4CEEA; Mon, 23 Jun 2025 21:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714824; bh=qECiqUSZ7hN7zS7wTTnTp7qeXjGT/Y7o9+a44kAlSzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PfIB8TKSlTwXV8ZjuQ2oO7VVCUJZ8039B9XraPIUi6Xhmo76dOFD7DGl6h8XrtSqK 4TgByv3OZKEM31fSNlQrF9xwnPvtCCrgUYmfsAe1AWNtENmO/orPgBM6Nn+hDzhvwU DqfWoU2guDtDct6eD4n9dSChNWnDJCksKFrRI9fU= 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.6 183/290] i40e: fix MMIO write access to an invalid page in i40e_clear_hw Date: Mon, 23 Jun 2025 15:07:24 +0200 Message-ID: <20250623130632.377399704@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.910356556@linuxfoundation.org> References: <20250623130626.910356556@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.6-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 4d7caa1199719..5d46a8e5376da 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1067,10 +1067,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