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 20CB319CC11; Mon, 23 Jun 2025 21:37:30 +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=1750714650; cv=none; b=l0dBq1RhMv7ji44fCdR9iKIhLwxkiqfHStFJ2hJGNqn93UQfpIb/mVjxaWeArUnbQ3ZmmUXiK5IxOSMyM9BmyDJxCuqqWLMPZEjkXdMY1FmYzXYgAfNeHsEGiONsu97SLWsS9ev2VK+gdREQ+qeSbX/AQn8L3fY+wz2XebjKVtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714650; c=relaxed/simple; bh=6oVnTyZJ/ATTsZYHNzMTZnDoqcZE6RB0rf2/9Qs7sM8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oFVJM+/mFuT+z3MDiorut1um65wiXo4/0Ivdg3QwxmUL+2L84UQxGPnjcw7IUQ9ZXiPE+NbxjctKpRAFmf/KqFYGxXg73BXZLF2bdsy+KbLr+S7DMOi0hSKKwc8I1OR03hgfgfY0u6KRTsBF6fswAtCBeXeNt732G1/qxxGt3TA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DUwegUdi; 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="DUwegUdi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88A67C4CEEA; Mon, 23 Jun 2025 21:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714650; bh=6oVnTyZJ/ATTsZYHNzMTZnDoqcZE6RB0rf2/9Qs7sM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DUwegUdiabgOR14zwQbJ/ZOGqHKA+aoN79+xytlwHJu+kUXi228oy395W9iDtwsP/ 04+qWnlpIfI5fECOAH/xEIK4S+7IFUKtkWJMWfyQiy5/95A8bGV6SASwOXWqQDgRZB 3m6z97Af/pe2XsVmWdx9fMSxGLavI0VYKKNpA670= 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.15 407/592] i40e: fix MMIO write access to an invalid page in i40e_clear_hw Date: Mon, 23 Jun 2025 15:06:05 +0200 Message-ID: <20250623130710.119162520@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130700.210182694@linuxfoundation.org> References: <20250623130700.210182694@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.15-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 370b4bddee441..b11c35e307ca9 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