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 9E16A37DE84; Thu, 12 Mar 2026 20:25:12 +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=1773347112; cv=none; b=U7gNqI2hx7nWA2C0UeHo7qxYCpQEdxPWtr0vJNtZmwgWfSa2w4fzHj1j6B9+5++NqluQGJIK2xdg5l4IAMsTY7/76GJhD6TCO9tlZhn2CqLANJAPaLqT0kcbnlS8baiopB5yLhAQOZvZZTlkXDpdEiw6ACqyBCvw764UC5dFtJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773347112; c=relaxed/simple; bh=/lamdCdedh7OfVaA7F5L7RMP25pkAoJk6tjGr+qp9TY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tLK2QY/5ecisORcNJnHjziqRtJzKv3z79EG90sb6fXXx78ltyuwAia1INg47h6/n8C8BOwQytmSslaDRRF+iKhrs+RZaa9e4x4HsEXXXg+5/Jr8Fs9Yo7eK8uTg/0j7jg+tFo/9hUkAPYQWp8jZwk9B8G7cV3RiU57NikoHPHdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R7IRzXjJ; 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="R7IRzXjJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1326FC4CEF7; Thu, 12 Mar 2026 20:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773347112; bh=/lamdCdedh7OfVaA7F5L7RMP25pkAoJk6tjGr+qp9TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R7IRzXjJnW0G1KQnc80+q7nL/dP+/9OohsY8b6w82D52HQeQ9pzTx9MuSAmMk6GYH JW33m8xUUuAKE4ikML6SEUhwcmdybtYOkLXneuqN469b/RqH8NbLGkz3p+u51DiDFc vue1LrCnkMIP32KVHibhz1IOhJ+y+k1NbLvF67og= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Junrui Luo , Guenter Roeck , Ioana Ciornei , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 189/265] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler Date: Thu, 12 Mar 2026 21:09:36 +0100 Message-ID: <20260312201025.140952108@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260312201018.128816016@linuxfoundation.org> References: <20260312201018.128816016@linuxfoundation.org> User-Agent: quilt/0.69 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: Guenter Roeck [ Upstream commit 74badb9c20b1a9c02a95c735c6d3cd6121679c93 ] Commit 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ handler") introduces a range check for if_id to avoid an out-of-bounds access. If an out-of-bounds if_id is detected, the interrupt status is not cleared. This may result in an interrupt storm. Clear the interrupt status after detecting an out-of-bounds if_id to avoid the problem. Found by an experimental AI code review agent at Google. Fixes: 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ handler") Cc: Junrui Luo Signed-off-by: Guenter Roeck Reviewed-by: Ioana Ciornei Link: https://patch.msgid.link/20260227055812.1777915-1-linux@roeck-us.net Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index e78f400784770..a7c8ec0bdfe53 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1532,7 +1532,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) if_id = (status & 0xFFFF0000) >> 16; if (if_id >= ethsw->sw_attr.num_ifs) { dev_err(dev, "Invalid if_id %d in IRQ status\n", if_id); - goto out; + goto out_clear; } port_priv = ethsw->ports[if_id]; @@ -1552,6 +1552,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) dpaa2_switch_port_connect_mac(port_priv); } +out_clear: err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, status); if (err) -- 2.51.0