В ядре Linux устранена следующая уязвимость:
HID: Sony: исправлен UAF ghl_poke_timer / ghl_urb при отмене драйвера. Для ключей GHL (Guitar Hero Live) sony_probe() запускает периодический таймер:
ghl_magic_poke() (обратный вызов таймера) отправляет sc->ghl_urb и URB
завершение ghl_magic_poke_cb() повторно активирует таймер с помощью mod_timer().
sony_remove() истощил таймер с помощью timer_delete_sync(), а затем освободил
URB с помощью usb_free_urb():
timer_delete_sync(&sc->ghl_poke_timer);
usb_free_urb (sc->ghl_urb);
timer_delete_sync() не блокирует повторную постановку на охрану, и пока URB находится в
рейс, таймер не находится в режиме ожидания, поэтому удаление синхронизации не выполняется. УРБ
завершение, которое запускается после удаления, повторно включает таймер и usb_free_urb()
только удаляет ссылку - он не убивает URB в полете.
СК это
выделяется с помощью devm_kzalloc() и освобождается после возврата sony_remove(), поэтому
повторно активирует ghl_poke_timer (встроенный в sc), затем срабатывает по освобожденной памяти,
использование после освобождения от таймера softirq. Это гонка с отключением/rmmod. Сначала отравите URB, затем выключите таймер, прежде чем освободить URB.
usb_poison_urb() убивает любой URB в полете и навсегда отклоняет дальнейшие
отправки, поэтому таймер тыка, который все еще находится в ожидании, не может повторно отправить
URB из ghl_magic_poke() в окне перед запуском timer_shutdown_sync().
usb_kill_urb() будет недостаточно: он только отменяет URB в полете и
оставляет его доступным для отправки после возвращения, поэтому ожидающий таймер может
повторно отправьте его и запустите новый URB над освобожденным sc.
timer_shutdown_sync() затем удаляет весь последний обратный вызов и блокирует повторную постановку на охрану.
Путь ошибки зонда не затрагивается: он достигается только до срабатывания таймера.
вооружен. Воспроизведено под KASAN на next-20260710 через dummy_hcd + raw-gadget.
эмуляция ключа GHL PS4 (VID 0x1430 / PID 0x07bb): привязка hid-sony
и включает таймер тыка, УРБ тыка удерживается в полете, водитель
несвязанный (освобождающий sc), тогда URB освобождается. Завершение перевооружает
таймер на освобожденной SC, и таймер повторной постановки срабатывает примерно через 8 секунд:
ОШИБКА: KASAN: slab-use-after-free в ghl_magic_poke+0x98/0xb0
Чтение размера 8 по адресу ffff88810b02fd50 с помощью Task swapper/0/0.
ghl_magic_poke+0x98/0xb0
call_timer_fn+0x35/0x2b0
__run_timers+0x69c/0x9a0
run_timer_softirq+0x173/0x2a0
Выделено задачей 169: sony_probe
Освобождено задачей 338: devres_release_group <- hid_device_remove (sony_remove)
Найдено пользователем 0sec (https://0sec.ai) с помощью автоматического анализа источника.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: HID: sony: fix UAF of ghl_poke_timer / ghl_urb at driver unbind For GHL (Guitar Hero Live) dongles, sony_probe() arms a periodic timer: ghl_magic_poke() (the timer callback) submits sc->ghl_urb, and the URB completion ghl_magic_poke_cb() re-arms the timer with mod_timer(). sony_remove() drained the timer with timer_delete_sync() and then freed the URB with usb_free_urb(): timer_delete_sync(&sc->ghl_poke_timer); usb_free_urb(sc->ghl_urb); timer_delete_sync() does not block re-arming, and while the URB is in flight the timer is not pending, so the sync delete is a no-op. A URB completion that runs after the delete re-arms the timer, and usb_free_urb() only drops a reference -- it does not kill an in-flight URB. sc is allocated with devm_kzalloc() and freed once sony_remove() returns, so the re-armed ghl_poke_timer (embedded in sc) then fires on freed memory, a use-after-free from timer softirq. This is a disconnect/rmmod race. Poison the URB first, then shut the timer down, before freeing the URB. usb_poison_urb() kills any in-flight URB and permanently rejects further submissions, so a poke timer that is still pending cannot re-submit the URB from ghl_magic_poke() in the window before timer_shutdown_sync() runs. usb_kill_urb() would not suffice: it only cancels the in-flight URB and leaves it submittable once it returns, so the pending timer could re-submit it and put a fresh URB in flight over the freed sc. timer_shutdown_sync() then drains any last callback and blocks re-arming. The probe error path is unaffected: it is only reached before the timer is armed. Reproduced under KASAN on next-20260710 via dummy_hcd + raw-gadget emulation of the GHL PS4 dongle (VID 0x1430 / PID 0x07bb): hid-sony binds and arms the poke timer, the poke URB is held in flight, the driver is unbound (freeing sc), then the URB is released. The completion re-arms the timer on the freed sc, and the re-armed timer fires ~8 s later: BUG: KASAN: slab-use-after-free in ghl_magic_poke+0x98/0xb0 Read of size 8 at addr ffff88810b02fd50 by task swapper/0/0 ghl_magic_poke+0x98/0xb0 call_timer_fn+0x35/0x2b0 __run_timers+0x69c/0x9a0 run_timer_softirq+0x173/0x2a0 Allocated by task 169: sony_probe Freed by task 338: devres_release_group <- hid_device_remove (sony_remove) Found by 0sec (https://0sec.ai) using automated source analysis.