В ядре Linux устранена следующая уязвимость:
Bluetooth: hci_sync: защитить обход списка UUID
Преобразование hci_sync переместило генерацию класса устройства и EIR из
Запрос HCI, созданный с помощью hddev->lock, обеспечивает асинхронную синхронизацию команд. Рабочий имеет hddev->req_lock, но эта блокировка не сериализует доступ.
к hdev->uuids против add_uuid() и Remove_uuid(), которые обновляют
список в разделе hddev->lock. Таким образом, может произойти следующее чередование:
CPU0 (работа синхронизации команд) CPU1 (сокет управления)
получить uuid из списка
list_del(&uuid->список)
kfree(uuid)
прочитать uuid->размер
KASAN сообщает о результате использования после освобождения:
ОШИБКА: KASAN: slab-use-after-free в eir_create+0xb8f/0xee0
Чтение размера 1 по адресу ffff88810dbd8620 с помощью задачи kworker/u17:0/87.
Рабочая очередь: hci0 hci_cmd_sync_work
Отслеживание вызова:
eir_create+0xb8f/0xee0
hci_update_eir_sync+0x1c0/0x330
hci_cmd_sync_work+0x13c/0x290
процесс_one_work+0x63a/0x1070
рабочий_поток+0x45b/0xd10
Выделено заданием 86:
__kasan_kmalloc+0x8f/0xa0
add_uuid+0x18a/0x4b0
hci_sock_sendmsg+0x1033/0x1ea0
Освобожден заданием 92:
__kasan_slab_free+0x43/0x70
kfree+0x131/0x3c0
удалить_uuid+0x25e/0x560
hci_sock_sendmsg+0x1033/0x1ea0
Удерживайте hddev->lock при создании и фиксации класса устройства и
Снимки EIR. Отпустите его перед отправкой команды HCI, чтобы контроллер
ожидания не происходят при блокировке устройства. Это защищает весь список UUID
ходит по этим путям и восстанавливает потерянную в команде сериализацию
синхронное преобразование.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_sync: Protect UUID list traversal The hci_sync conversion moved class-of-device and EIR generation from an HCI request built under hdev->lock to asynchronous command sync work. The worker holds hdev->req_lock, but that lock does not serialize access to hdev->uuids against add_uuid() and remove_uuid(), which update the list under hdev->lock. The following interleaving can therefore occur: CPU0 (command sync work) CPU1 (management socket) fetch uuid from the list list_del(&uuid->list) kfree(uuid) read uuid->size KASAN reports the resulting use-after-free: BUG: KASAN: slab-use-after-free in eir_create+0xb8f/0xee0 Read of size 1 at addr ffff88810dbd8620 by task kworker/u17:0/87 Workqueue: hci0 hci_cmd_sync_work Call Trace: eir_create+0xb8f/0xee0 hci_update_eir_sync+0x1c0/0x330 hci_cmd_sync_work+0x13c/0x290 process_one_work+0x63a/0x1070 worker_thread+0x45b/0xd10 Allocated by task 86: __kasan_kmalloc+0x8f/0xa0 add_uuid+0x18a/0x4b0 hci_sock_sendmsg+0x1033/0x1ea0 Freed by task 92: __kasan_slab_free+0x43/0x70 kfree+0x131/0x3c0 remove_uuid+0x25e/0x560 hci_sock_sendmsg+0x1033/0x1ea0 Hold hdev->lock while generating and committing the class-of-device and EIR snapshots. Release it before sending an HCI command, so controller waits do not happen under the device lock. This protects all UUID list walks in these paths and restores the serialization lost in the command sync conversion.
Характеристики атаки
Последствия
Строка CVSS v3.1