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] |= ...
A buffer overflow vulnerability exists in the Linux kernel's dpaa2-switch driver where unvalidated firmware-provided interface count (num_ifs) can exceed the fixed array size (DPSW_MAX_IF=64), causing out-of-bounds writes. This affects systems using NXP DPAA2 network switches, particularly in data center and telecom infrastructure. The vulnerability requires malicious or compromised firmware to trigger but can lead to kernel memory corruption and potential privilege escalation.
1. IMMEDIATE: Identify systems running Linux kernel with dpaa2-switch driver by checking kernel version and loaded modules (lsmod | grep dpaa2)
2. Apply kernel patch that adds validation check: num_ifs >= DPSW_MAX_IF should be rejected during dpaa2_switch_init()
3. Update to patched kernel versions (7.0-rc2 or later, or backported patches for stable branches)
4. Verify firmware integrity and source from trusted NXP channels only
5. Implement firmware signature verification if available
6. Monitor system logs for dpaa2-switch initialization errors
7. Detection: Monitor for kernel oops/panic messages related to dpaa2_switch_fdb_get_flood_cfg() or memory corruption patterns
8. Compensating control: Restrict firmware update access to authorized personnel only; implement secure boot to prevent unauthorized firmware modifications
1. فوري: تحديد الأنظمة التي تقوم بتشغيل نواة Linux مع برنامج تشغيل dpaa2-switch عن طريق التحقق من إصدار النواة والوحدات المحملة (lsmod | grep dpaa2)
2. تطبيق رقعة النواة التي تضيف فحص التحقق: يجب رفض num_ifs >= DPSW_MAX_IF أثناء dpaa2_switch_init()
3. التحديث إلى إصدارات النواة المصححة (7.0-rc2 أو أحدث، أو الرقع المرتجعة للفروع المستقرة)
4. التحقق من سلامة البرامج الثابتة والحصول عليها من قنوات NXP الموثوقة فقط
5. تنفيذ التحقق من توقيع البرامج الثابتة إن أمكن
6. مراقبة سجلات النظام لأخطاء تهيئة dpaa2-switch
7. الكشف: مراقبة رسائل kernel oops/panic المتعلقة بـ dpaa2_switch_fdb_get_flood_cfg() أو أنماط تلف الذاكرة
8. التحكم التعويضي: تقييد وصول تحديث البرامج الثابتة للموظفين المصرح لهم فقط؛ تنفيذ التمهيد الآمن لمنع تعديلات البرامج الثابتة غير المصرح بها