В ядре Linux устранена следующая уязвимость:
usb: atm: ueagle-atm: отклонять дескрипторы, которые сбивают с толку зонд и отключаются
uea_probe() отличает допрошивное устройство от послепрошивного
используя идентификатор USB (UEA_IS_PREFIRM()), и сохраняет другой объект в качестве
данные интерфейса в каждом случае: «завершение структуры» для предварительной прошивки
устройство (которое будет ожидаться в .disconnect()) или «struct usbatm_data» для
послепрошивной.
uea_disconnect() вместо этого различает их по количеству интерфейсов.
активной конфигурации (устройство предварительной прошивки предоставляет один
интерфейс, у ADI930 их 2, а у eagle 3), и он передает данные интерфейса
соответственно.
Поскольку два обработчика используют разные критерии, созданное устройство, которое
объявляет идентификатор предварительной прошивки вместе с дескриптором мультиинтерфейса
(или идентификатор после прошивки с единым интерфейсом) заставляет их не согласиться:
небольшое «завершение структуры», сохраненное функцией uea_probe(), затем передается в
usbatm_usb_disconnect(), который приводит его к «struct usbatm_data» и принимает
экземпляр->сериализовать, читая конец выделения:
ОШИБКА: KASAN: плита выходит за пределы границ в __mutex_lock+0x152a/0x1b80.
Чтение размера 8 по адресу ffff8880470e2c60 с помощью задачи kworker/1:2/982.
...
__mutex_lock+0x152a/0x1b80
usbatm_usb_disconnect+0x70/0x820
uea_disconnect+0x133/0x2c0
usb_unbind_interface+0x1dd/0x9e0
...
который принадлежит кешу kmalloc-96 размером 96
Адрес ошибки расположен в 0 байтах справа от
выделенная 96-байтовая область [ffff8880470e2c00, ffff8880470e2c60)
Отклоняйте такие противоречивые дескрипторы в uea_probe(), чтобы оба обработчика
всегда принимайте одно и то же решение до/после прошивки.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: usb: atm: ueagle-atm: reject descriptors that confuse probe and disconnect uea_probe() distinguishes a pre-firmware device from a post-firmware one using the USB id (UEA_IS_PREFIRM()), and stores a different object as the interface data in each case: a 'struct completion' for a pre-firmware device (to be waited on in .disconnect()), or a 'struct usbatm_data' for a post-firmware one. uea_disconnect() instead tells the two apart by the number of interfaces of the active configuration (a pre-firmware device exposes a single interface, ADI930 has 2 and eagle has 3), and casts the interface data accordingly. Because the two handlers use different criteria, a crafted device that advertises a pre-firmware id together with a multi-interface descriptor (or a post-firmware id with a single interface) makes them disagree: the small 'struct completion' stored by uea_probe() is then passed to usbatm_usb_disconnect(), which casts it to 'struct usbatm_data' and takes instance->serialize, reading past the end of the allocation: BUG: KASAN: slab-out-of-bounds in __mutex_lock+0x152a/0x1b80 Read of size 8 at addr ffff8880470e2c60 by task kworker/1:2/982 ... __mutex_lock+0x152a/0x1b80 usbatm_usb_disconnect+0x70/0x820 uea_disconnect+0x133/0x2c0 usb_unbind_interface+0x1dd/0x9e0 ... which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes to the right of allocated 96-byte region [ffff8880470e2c00, ffff8880470e2c60) Reject such inconsistent descriptors in uea_probe() so that both handlers always make the same pre/post-firmware decision.