CVE-2026-43205: dpaa2-switch: validate num_ifs to prevent out-of-bounds write
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dpaa2-switch: validate num_ifs to prevent out-of-bounds write
The driver obtains sw_attr.num_ifs from firmware via dpsw_get_attributes() but never validates it against DPSW_MAX_IF (64). This value controls iteration in dpaa2_switch_fdb_get_flood_cfg(), which writes port indices into the fixed-size cfg->if_id[DPSW_MAX_IF] array. When firmware reports num_ifs >= 64, the loop can write past the array bounds.
Add a bound check for num_ifs in dpaa2_switch_init().
dpaa2_switch_fdb_get_flood_cfg() appends the control interface (port num_ifs) after all matched ports. When num_ifs == DPSW_MAX_IF and all ports match the flood filter, the loop fills all 64 slots and the control interface write overflows by one entry.
The check uses >= because num_ifs == DPSW_MAX_IF is also functionally broken.
build_if_id_bitmap() silently drops any ID >= 64:
if (id[i] < DPSW_MAX_IF)
bmap[id[i] / 64] |= ...The Linux kernel CVE team has assigned CVE-2026-43205 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 5.15.202 with commit a26dda3bae469c8e4e1b1993ad33dafa32d0fc28 Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 6.1.165 with commit a3034a8d56174dd6464c46823438f25797910a8d Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 6.6.128 with commit b690635d4719214892855b79ce018d4b1672ac96 Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 6.12.75 with commit 8b841fd529db9faf8bc678d429d4bf4e98b10900 Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 6.18.16 with commit 89764cf44544e943230f5e03b8c40a90da26537c Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 6.19.6 with commit c18493f750208eb4ff1198fc5a02786b8b2d70a6 Issue introduced in 5.13 with commit 539dda3c5d190c5088b5e57944b1b482fcb464de and fixed in 7.0 with commit 8a5752c6dcc085a3bfc78589925182e4e98468c5
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-43205
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/a26dda3bae469c8e4e1b1993ad33dafa32d0fc28 https://git.kernel.org/stable/c/a3034a8d56174dd6464c46823438f25797910a8d https://git.kernel.org/stable/c/b690635d4719214892855b79ce018d4b1672ac96 https://git.kernel.org/stable/c/8b841fd529db9faf8bc678d429d4bf4e98b10900 https://git.kernel.org/stable/c/89764cf44544e943230f5e03b8c40a90da26537c https://git.kernel.org/stable/c/c18493f750208eb4ff1198fc5a02786b8b2d70a6 https://git.kernel.org/stable/c/8a5752c6dcc085a3bfc78589925182e4e98468c5