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 D84BE2EBB8C; Mon, 13 Apr 2026 16:21:07 +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=1776097267; cv=none; b=Amoaac4mbnJFXwPBTcxqOfK11LaGI86nGWLz8eal+j65VIoVAAL+57oB53yXS5IBolXPcshHXxJkE9RJioaIibDfXN3+AVQ5xGJTT1Xt4vMg1SPIRixnBkWC0PyKpdIoKCRYJrRu6EQM0lUCxeGtBEOfNzTbEj8U5R4wCLyOA/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776097267; c=relaxed/simple; bh=VB3KFvYicXrSr0gZk+cUF/dyWAuN1SMaEiaF9MWCcJE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pNNrEiTRbuuTCgwfpOICGTtkvrHCL6oHvoahIw14cp49V0BMTSdRu7YXAJVoVyF/UVuyUcND9t4DYbXjul5m4ut0d98KXr35GfTwG4D0r/Zr/F7JzghYt3u79N389A2f18D0GUBrDJUJphuO3EOm+S6bM8kMT7JVOfFC3rpcbWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bk5sT5u3; 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="bk5sT5u3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FB4FC2BCAF; Mon, 13 Apr 2026 16:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776097267; bh=VB3KFvYicXrSr0gZk+cUF/dyWAuN1SMaEiaF9MWCcJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bk5sT5u3ipJXhcIZPY7U9wfBi86ak09Z8GUfE271zGdnU+LMUTxVx/FN+G/5wdm7+ g8Zq3Un9G+siAkpylBxwBGQfMBPYtSzhgzb0w+mj3KHhm2EsGN4aXcqKwhTrdOOBdg JAkpXyde0WKtwU5PEh1sD75UB1yReE2Rm4B4MH0U= 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 5.15 070/570] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler Date: Mon, 13 Apr 2026 17:53:21 +0200 Message-ID: <20260413155833.065505206@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 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.15-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 9713d04238138..3cc844a61cb88 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]; @@ -1555,6 +1555,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) rtnl_unlock(); } +out_clear: err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, status); if (err) -- 2.51.0