dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler
Subsystems (3)
PATCH 1/1 dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler
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.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +2 -1
@@ -1533,7 +1533,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];
@@ -1553,6 +1553,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)
Signature · 1 line
2.45.2
Quoted 8 lines · Guenter Roeck
Commit
31a7a0bbeb00("dpaa2-switch: add bounds check forif_idin IRQ handler") introduces a range check forif_idto avoid an out-of-bounds access. If an out-of-boundsif_idis 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_idto avoid the problem.
Quoted 6 lines
Found by an experimental AI code review agent at Google.
Fixes 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ handler")Cc Jakub Kicinski <[email protected]>Cc Junrui Luo <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 26 Feb 2026 21:58:12 -0800 you wrote:
Commit
31a7a0bbeb00("dpaa2-switch: add bounds check forif_idin IRQ handler") introduces a range check forif_idto avoid an out-of-bounds access. If an out-of-boundsif_idis 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_idto avoid the problem.[...]
Here is the summary with links:
- dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler
https://git.kernel.org/netdev/net/c/74badb9c20b1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html