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 C25711FECBA; Mon, 23 Jun 2025 21:50:08 +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=1750715408; cv=none; b=ZhZJhN8R3b7scUe4GTc8JmYY+MSjP7xLgSDnGgnQD+L6520r4FXncHc0N7LMkOCiNQbjOU2/4uwGnePXXUiIkSwxgVAbxDEa9wktd6uUxno+NT1YXyF0wgOdOyVRqgjk4iKj741puBiui1o96REWUCP1k3V9h8DkbI0K2wMO9E4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750715408; c=relaxed/simple; bh=oeosfllot4M7zWmF4OVqy8krrz1OMlAe+QYtYe/nWh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qiRDX10ypfL77zCFtKyum/5it6h5zoGdBkHGoErTF+yMwwJnwh2VRiV6SUJ+FrFaAmao/WEwlSjRYkmhBXU3quEBL2slpjJk0UDBTWjGgmBPpHsDSe2Enrx0gZxEDCPb6AHdXBmKpcMR/Pjxa96DGvHWlsCRTQl5e1WB2DUN/VU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qK4LC6VT; 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="qK4LC6VT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A9D3C4CEEA; Mon, 23 Jun 2025 21:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750715408; bh=oeosfllot4M7zWmF4OVqy8krrz1OMlAe+QYtYe/nWh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qK4LC6VTbT25FVdETJIx6uGxyxmvrzh0lqjesWjf6sE2TN5Vz3wEk4apT4Zq5ITM/ x5pY9czrrAzICoGtrvW+9UEPkKAnz1DtKcDfdzrJSkoilQE6yXV8wnHtuJEy2i5L4e BBZJdvzJUew8UpSsnJKgdOJbky3dxIaM1SDD1XIU= 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 5.10 273/355] i40e: fix MMIO write access to an invalid page in i40e_clear_hw Date: Mon, 23 Jun 2025 15:07:54 +0200 Message-ID: <20250623130634.980042950@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.716971725@linuxfoundation.org> References: <20250623130626.716971725@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 59a467f7aba3f..430f236be6538 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1320,10 +1320,11 @@ i40e_status 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