In the Linux kernel, the following vulnerability has been resolved:
power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler
Using the `devm_` variant for requesting IRQ _before_ the `devm_`
variant for allocating/registering the `extcon` handle, means that the
`extcon` handle will be deallocated/unregistered _before_ the interrupt
handler (since `devm_` naturally deallocates in reverse allocation
order). This means that during removal, there is a race condition where
an interrupt can fire just _after_ the `extcon` handle has been
freed, *but* just _before_ the corresponding unregistration of the IRQ
handler has run.
This will lead to the IRQ handler calling `extcon_set_state_sync()` with
a freed `extcon` handle. Which usually crashes the system or otherwise
silently corrupts the memory...
Fix this racy use-after-free by making sure the IRQ is requested _after_
the registration of the `extcon` handle.
A use-after-free vulnerability exists in the Linux kernel's PM8916 battery charger driver (pm8916_lbc) affecting the extcon handle in IRQ handlers. The vulnerability occurs due to improper deallocation order during device removal, where interrupts can fire after the extcon handle is freed but before the IRQ handler is unregistered. This can lead to system crashes or memory corruption on affected devices.
1. IMMEDIATE ACTIONS:
- Identify all Linux systems running affected kernel versions with PM8916 battery charger drivers
- Prioritize systems in critical infrastructure and production environments
- Monitor system logs for kernel panics or memory corruption errors
2. PATCHING GUIDANCE:
- Apply the latest Linux kernel patch that reorders IRQ registration to occur after extcon handle allocation
- Verify patch application by checking kernel version and driver code review
- Test patches in non-production environments before deployment
3. COMPENSATING CONTROLS (if immediate patching unavailable):
- Disable PM8916 driver if not essential to operations
- Implement system monitoring for kernel panics and memory errors
- Schedule maintenance windows for kernel updates
- Use kernel module blacklisting if the driver is not required
4. DETECTION RULES:
- Monitor kernel logs for "use-after-free" messages related to pm8916_lbc
- Alert on unexpected kernel panics or oops messages
- Track system crashes correlated with power management events
- Monitor for memory corruption indicators in system diagnostics
1. الإجراءات الفورية:
- تحديد جميع أنظمة لينكس التي تعمل بإصدارات نواة متأثرة مع برامج تشغيل شاحن البطارية PM8916
- إعطاء الأولوية للأنظمة في البنية التحتية الحرجة وبيئات الإنتاج
- مراقبة سجلات النظام للبحث عن أعطال النواة أو أخطاء تلف الذاكرة
2. إرشادات التصحيح:
- تطبيق أحدث تصحيح نواة لينكس الذي يعيد ترتيب تسجيل المقاطعة ليحدث بعد تخصيص معالج extcon
- التحقق من تطبيق التصحيح من خلال مراجعة إصدار النواة وكود برنامج التشغيل
- اختبار التصحيحات في بيئات غير الإنتاج قبل النشر
3. الضوابط البديلة (إذا لم يكن التصحيح الفوري متاحاً):
- تعطيل برنامج تشغيل PM8916 إذا لم يكن ضروريًا للعمليات
- تنفيذ مراقبة النظام لأعطال النواة وأخطاء الذاكرة
- جدولة نوافذ الصيانة لتحديثات النواة
- استخدام إدراج وحدة النواة في القائمة السوداء إذا لم تكن برنامج التشغيل مطلوبة
4. قواعد الكشف:
- مراقبة سجلات النواة للبحث عن رسائل "use-after-free" المتعلقة بـ pm8916_lbc
- التنبيه على أعطال النواة غير المتوقعة أو رسائل الأخطاء
- تتبع أعطال النظام المرتبطة بأحداث إدارة الطاقة
- مراقبة مؤشرات تلف الذاكرة في تشخيصات النظام