В ядре Linux устранена следующая уязвимость:
Bluetooth: L2CAP: исправлено использование после освобождения в l2cap_unregister_user. После фиксации ab4eedb790ca («Bluetooth: L2CAP: исправить поврежденный список в
hci_chan_del"), l2cap_conn_del() использует conn->lock для защиты доступа к
конн->пользователи. Однако l2cap_register_user() и l2cap_unregister_user()
не используйте conn->lock, создавая состояние гонки, в котором эти функции могут
доступ к conn->users и conn->hchan одновременно с помощью l2cap_conn_del().
Как сообщается, это может привести к использованию после освобождения и повреждению списка ошибок.
от сизбота. Исправьте это, изменив l2cap_register_user() и l2cap_unregister_user().
использовать conn->lock вместо hci_dev_lock(), обеспечивая последовательную блокировку
для структуры l2cap_conn.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: Fix use-after-free in l2cap_unregister_user After commit ab4eedb790ca ("Bluetooth: L2CAP: Fix corrupted list in hci_chan_del"), l2cap_conn_del() uses conn->lock to protect access to conn->users. However, l2cap_register_user() and l2cap_unregister_user() don't use conn->lock, creating a race condition where these functions can access conn->users and conn->hchan concurrently with l2cap_conn_del(). This can lead to use-after-free and list corruption bugs, as reported by syzbot. Fix this by changing l2cap_register_user() and l2cap_unregister_user() to use conn->lock instead of hci_dev_lock(), ensuring consistent locking for the l2cap_conn structure.