Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Fixes: 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ handler")
Cc: Junrui Luo <moonafterrain@outlook.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://patch.msgid.link/20260227055812.1777915-1-linux@roeck-us.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Guenter Roeck and committed by
Jakub Kicinski
74badb9c 0eb5965b

+2 -1
+2 -1
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
··· 1533 1533 if_id = (status & 0xFFFF0000) >> 16; 1534 1534 if (if_id >= ethsw->sw_attr.num_ifs) { 1535 1535 dev_err(dev, "Invalid if_id %d in IRQ status\n", if_id); 1536 - goto out; 1536 + goto out_clear; 1537 1537 } 1538 1538 port_priv = ethsw->ports[if_id]; 1539 1539 ··· 1553 1553 dpaa2_switch_port_connect_mac(port_priv); 1554 1554 } 1555 1555 1556 + out_clear: 1556 1557 err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, 1557 1558 DPSW_IRQ_INDEX_IF, status); 1558 1559 if (err)