В ядре Linux устранена следующая уязвимость:
Bluetooth: hci_sync: исправлен UAF в hci_le_create_cis_sync
hci_le_create_cis_sync() разыменовывает conn->conn_timeout после выпуска
как rcu_read_lock(), так и hci_dev_lock(hdev). Указатель подключения был
полученный в результате итерации, защищенной RCU, по hddev->conn_hash.list и
недействителен после снятия этих блокировок. Одновременное отключение может
освободите hci_conn между разблокировкой и разыменованием, что приведет к
использовать после бесплатного чтения.
Механизм отмены в hci_conn_del() не может предотвратить это, потому что
hci_le_create_cis_pending() ставит в очередь hci_create_cis_sync с data=NULL:
hci_cmd_sync_queue(hdev, hci_create_cis_sync, NULL, NULL);
Пока hci_conn_del() удаляет из очереди с data=conn:
hci_cmd_sync_dequeue (hdev, NULL, conn, NULL);
Поскольку NULL != conn, поиск в _hci_cmd_sync_lookup_entry() никогда не выполняется.
совпадает, и ожидающий рабочий элемент не отменяется. Исправьте это, сохранив conn->conn_timeout в локальную переменную, пока
блокировки по-прежнему удерживаются, поэтому устаревший указатель conn никогда не разыменовывается
после разблокировки. Это тот же класс ошибок, что и исправленный коммитом 035c25007c9e.
(«Bluetooth: hci_sync: исправить UAF на le_read_features_complete»), который
обратился к идентичному шаблону в другой функции.
Эта уязвимость была обнаружена с помощью 0sec.ai, открытого исходного кода.
автоматизированная платформа аудита безопасности (https://github.com/0sec-labs).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_sync: fix UAF in hci_le_create_cis_sync hci_le_create_cis_sync() dereferences conn->conn_timeout after releasing both rcu_read_lock() and hci_dev_lock(hdev). The conn pointer was obtained from an RCU-protected iteration over hdev->conn_hash.list and is not valid once these locks are dropped. A concurrent disconnect can free the hci_conn between the unlock and the dereference, causing a use-after-free read. The cancellation mechanism in hci_conn_del() cannot prevent this because hci_le_create_cis_pending() queues hci_create_cis_sync with data=NULL: hci_cmd_sync_queue(hdev, hci_create_cis_sync, NULL, NULL); While hci_conn_del() dequeues with data=conn: hci_cmd_sync_dequeue(hdev, NULL, conn, NULL); Since NULL != conn, the lookup in _hci_cmd_sync_lookup_entry() never matches, and the pending work item is not cancelled. Fix this by saving conn->conn_timeout into a local variable while the locks are still held, so the stale conn pointer is never dereferenced after unlock. This is the same class of bug as the one fixed by commit 035c25007c9e ("Bluetooth: hci_sync: Fix UAF on le_read_features_complete") which addressed the identical pattern in a different function. This vulnerability was identified using 0sec.ai, an open-source automated security auditing platform (https://github.com/0sec-labs).
Характеристики атаки
Последствия
Строка CVSS v3.1