In the Linux kernel, the following vulnerability has been resolved:
can: raw: fix ro->uniq use-after-free in raw_rcv()
raw_release() unregisters raw CAN receive filters via can_rx_unregister(),
but receiver deletion is deferred with call_rcu(). This leaves a window
where raw_rcv() may still be running in an RCU read-side critical section
after raw_release() frees ro->uniq, leading to a use-after-free of the
percpu uniq storage.
Move free_percpu(ro->uniq) out of raw_release() and into a raw-specific
socket destructor. can_rx_unregister() takes an extra reference to the
socket and only drops it from the RCU callback, so freeing uniq from
sk_destruct ensures the percpu area is not released until the relevant
callbacks have drained.
[mkl: applied manually]
CVE-2026-31532 is a use-after-free vulnerability in the Linux kernel's CAN (Controller Area Network) raw socket implementation. The vulnerability occurs when raw_release() frees memory (ro->uniq) while raw_rcv() may still be accessing it due to deferred RCU callback execution, potentially leading to kernel memory corruption or denial of service. This affects systems using CAN bus interfaces, particularly in automotive and industrial control applications.
1. IMMEDIATE ACTIONS:
- Identify all systems running affected Linux kernel versions (check: uname -r)
- Prioritize patching for systems with CAN bus interfaces or industrial control applications
- Implement network segmentation to isolate CAN-enabled systems from untrusted networks
2. PATCHING GUIDANCE:
- Apply the latest stable kernel patch that includes the raw socket destructor fix
- For RHEL/CentOS: Update kernel-* packages via yum/dnf
- For Ubuntu: Update linux-image-* packages via apt
- For Debian: Update linux-image-* packages via apt
- Reboot systems after kernel update to activate patches
3. COMPENSATING CONTROLS (if immediate patching unavailable):
- Disable CAN raw socket functionality if not required: modprobe -r can_raw
- Restrict CAN socket access via AppArmor/SELinux policies
- Monitor for kernel oops/panic messages in syslog
- Implement strict access controls on /dev/can* devices
4. DETECTION RULES:
- Monitor kernel logs for: 'BUG: unable to handle page fault', 'use-after-free', 'KASAN: use-after-free'
- Alert on unexpected kernel panics on systems with CAN interfaces
- Track CAN raw socket creation/destruction via auditd: auditctl -w /proc/net/can_raw -p wa
1. الإجراءات الفورية:
- تحديد جميع الأنظمة التي تعمل بإصدارات نواة Linux المتأثرة (تحقق: uname -r)
- إعطاء الأولوية لتصحيح الأنظمة التي تحتوي على واجهات ناقل CAN أو تطبيقات التحكم الصناعي
- تنفيذ تقسيم الشبكة لعزل الأنظمة المدعومة بـ CAN عن الشبكات غير الموثوقة
2. إرشادات التصحيح:
- تطبيق أحدث تصحيح نواة مستقر يتضمن إصلاح مدمر مقبس خام
- لـ RHEL/CentOS: تحديث حزم kernel-* عبر yum/dnf
- لـ Ubuntu: تحديث حزم linux-image-* عبر apt
- لـ Debian: تحديث حزم linux-image-* عبر apt
- إعادة تشغيل الأنظمة بعد تحديث النواة لتفعيل التصحيحات
3. الضوابط البديلة (إذا لم يكن التصحيح الفوري متاحاً):
- تعطيل وظيفة مقبس CAN الخام إذا لم تكن مطلوبة: modprobe -r can_raw
- تقييد وصول مقبس CAN عبر سياسات AppArmor/SELinux
- مراقبة رسائل kernel oops/panic في syslog
- تنفيذ ضوابط وصول صارمة على أجهزة /dev/can*
4. قواعد الكشف:
- مراقبة سجلات النواة للبحث عن: 'BUG: unable to handle page fault', 'use-after-free', 'KASAN: use-after-free'
- تنبيه على حالات kernel panic غير المتوقعة على الأنظمة التي تحتوي على واجهات CAN
- تتبع إنشاء/تدمير مقبس CAN الخام عبر auditd: auditctl -w /proc/net/can_raw -p wa