В ядре Linux устранена следующая уязвимость:
ALSA: caiaq: исправлена утечка счетчика ссылок usb_dev при сбое зонда
create_card() получает ссылку на USB-устройство с помощью usb_get_dev()
и сохраняет соответствующий usb_put_dev() в card_free(), который
установлен как деструктор snd_card ->private_free. Однако ->private_free назначается только в конце init_card(),
после нескольких точек сбоя (usb_set_interface(), проверки типа EP,
usb_submit_urb(), обмен EP1_CMD_GET_DEVICE_INFO и его
тайм-аут). Если какой-либо из них терпит неудачу, init_card() возвращает ошибку
snd_probe(), который вызывает snd_card_free(card).
Потому что ->private_free
по-прежнему NULL, card_free() никогда не запускается, ссылка usb_get_dev()
не удаляется, и структура usb_device просачивается вместе со своим
выделения дескрипторов и device_private.
syzbot воспроизводит это с помощью искаженного устройства UAC3, единственное допустимое устройство которого
альтернативная настройка равна 0; вызов usb_set_interface(usb_dev, 0, 1) init_card()
завершается с ошибкой -EIO и вызывает утечку. Немедленно переместите назначение ->private_free в create_card().
после usb_get_dev(), чтобы каждый путь ошибки достигал snd_card_free()
балансирует ссылку. вызовы card_free() (snd_usb_caiaq_input_free,
free_urbs, kfree) уже допускают частично инициализированное состояние
потому что частная область чипа инициализируется нулями с помощью snd_card_new().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ALSA: caiaq: fix usb_dev refcount leak on probe failure create_card() takes a reference on the USB device with usb_get_dev() and stores the matching usb_put_dev() in card_free(), which is installed as the snd_card's ->private_free destructor. However, ->private_free is only assigned near the end of init_card(), after several failure points (usb_set_interface(), EP type checks, usb_submit_urb(), the EP1_CMD_GET_DEVICE_INFO exchange, and its timeout). When any of those fail, init_card() returns an error to snd_probe(), which calls snd_card_free(card). Because ->private_free is still NULL, card_free() never runs, the usb_get_dev() reference is not dropped, and the struct usb_device leaks along with its descriptor allocations and device_private. syzbot reproduces this with a malformed UAC3 device whose only valid altsetting is 0; init_card()'s usb_set_interface(usb_dev, 0, 1) call fails with -EIO and triggers the leak. Move the ->private_free assignment into create_card(), immediately after usb_get_dev(), so that every error path reaching snd_card_free() balances the reference. card_free()'s callees (snd_usb_caiaq_input_free, free_urbs, kfree) already tolerate the partially-initialized state because the chip private area is zero-initialized by snd_card_new().
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.6.136
|
6.6.140
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.12.84
|
6.12.86
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18.25
|
6.18.27
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.0.2
|
7.0.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
|
— | — |