In the Linux kernel, the following vulnerability has been resolved:
hwmon: (powerz) Fix use-after-free on USB disconnect
After powerz_disconnect() frees the URB and releases the mutex, a
subsequent powerz_read() call can acquire the mutex and call
powerz_read_data(), which dereferences the freed URB pointer.
Fix by:
- Setting priv->urb to NULL in powerz_disconnect() so that
powerz_read_data() can detect the disconnected state.
- Adding a !priv->urb check at the start of powerz_read_data()
to return -ENODEV on a disconnected device.
- Moving usb_set_intfdata() before hwmon registration so the
disconnect handler can always find the priv pointer.
A use-after-free vulnerability exists in the Linux kernel's powerz hwmon driver that can be triggered when a USB device is disconnected while a read operation is in progress. An attacker with physical access to a system or ability to trigger USB disconnection events could potentially cause a kernel crash or execute arbitrary code. The vulnerability affects systems using the powerz power monitoring device driver.
Immediate Actions:
1. Identify systems running Linux kernel versions with the powerz driver enabled
2. Check if powerz USB devices are connected to critical infrastructure
3. Implement physical access controls to USB ports on affected systems
Patching Guidance:
1. Update Linux kernel to the latest patched version (check your distribution's security advisories)
2. Apply kernel patches that include the fix: setting priv->urb to NULL in powerz_disconnect(), adding !priv->urb check in powerz_read_data(), and moving usb_set_intfdata() before hwmon registration
3. Test patches in non-production environment before deployment
Compensating Controls (if immediate patching not possible):
1. Disable the powerz driver if not actively used: echo 'blacklist powerz' >> /etc/modprobe.d/blacklist.conf
2. Restrict USB device access through BIOS/UEFI settings
3. Implement USB port locks on physical servers
4. Monitor kernel logs for hwmon-related errors and USB disconnect events
Detection Rules:
1. Monitor for kernel panic messages related to powerz driver
2. Alert on unexpected USB device disconnections during active monitoring sessions
3. Track kernel module load/unload events for powerz driver
4. Monitor dmesg for 'use-after-free' or 'NULL pointer dereference' messages
الإجراءات الفورية:
1. تحديد الأنظمة التي تشغل إصدارات نواة Linux مع تفعيل برنامج تشغيل powerz
2. التحقق من توصيل أجهزة USB من powerz بالبنية التحتية الحرجة
3. تطبيق ضوابط الوصول الفيزيائي لمنافذ USB على الأنظمة المتأثرة
إرشادات التصحيح:
1. تحديث نواة Linux إلى أحدث إصدار مصحح (تحقق من تنبيهات الأمان الخاصة بتوزيعتك)
2. تطبيق تصحيحات النواة التي تتضمن الإصلاح: تعيين priv->urb إلى NULL في powerz_disconnect()، إضافة فحص !priv->urb في powerz_read_data()، ونقل usb_set_intfdata() قبل تسجيل hwmon
3. اختبر التصحيحات في بيئة غير الإنتاج قبل النشر
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تعطيل برنامج تشغيل powerz إذا لم يكن قيد الاستخدام النشط
2. تقييد وصول جهاز USB من خلال إعدادات BIOS/UEFI
3. تطبيق أقفال منافذ USB على الخوادم الفيزيائية
4. مراقبة سجلات النواة للأخطاء المتعلقة بـ hwmon وأحداث قطع الاتصال
قواعد الكشف:
1. مراقبة رسائل انهيار النواة المتعلقة ببرنامج تشغيل powerz
2. التنبيه على قطع الاتصال غير المتوقع لأجهزة USB أثناء جلسات المراقبة النشطة
3. تتبع أحداث تحميل/تفريغ وحدات النواة لبرنامج تشغيل powerz
4. مراقبة dmesg للبحث عن رسائل 'use-after-free' أو 'NULL pointer dereference'