В ядре Linux была устранена следующая уязвимость: ksmbd: fix app-instance non-durable replace session UAF ksmbd_close_fd_app_instance_id() заменяет a prior open, который имеет тот же AppInstanceId. Он достигает этой открытой сессии через opinfo->sess. Этот указатель не пересчитывается.
Разрыв сеанса отсоединяет прочные ручки, прежде чем освободить сеанс. Он не отделяет недолговечный открытый. Это открытие по-прежнему указывает на сессии через opinfo->sess после того, как сессия освобождена.
В то же время другая сессия может заменить открытую. Затем замена принимает блокировку записи через устаревший указатель в файловой таблице освобожденного сеанса. BUG: KASAN: slab-use-after-free в _raw_write_lock+0x71/0xd0 Call Trace: _raw_write_lock+0x71/0xd0 ksmbd_close_fd_app_instance_id+0xd9/0x670 [ksmbd] smb2_open+0x3e10/0xd910 [ksmbd] Freed по заданию 212: ksmbd_session_destroy+0x38d/0x480 [ksmbd] Исправьте это, просмотрев сеанс opinfo->session_id.
Поиск возвращает ссылку, как это делает smb2_break_collect_channels(). Проверьте, что opinfo->sess по-прежнему указывает на него, прежде чем использовать его. Выполните поиск без удержания m_lock. destroy_previous_session () берет m_lock под блокировку сессионного стола, и принятие их в другом порядке здесь зашло бы в тупик.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix app-instance non-durable supersede session UAF ksmbd_close_fd_app_instance_id() supersedes a prior open that has the same AppInstanceId. It reaches that open's session through opinfo->sess. This pointer is not refcounted. Session teardown detaches durable handles before it frees the session. It does not detach a non-durable open. That open still points at the session through opinfo->sess after the session is freed. Another session can supersede the open at the same time. The supersede then takes a write lock through the stale pointer, in the freed session's file table. BUG: KASAN: slab-use-after-free in _raw_write_lock+0x71/0xd0 Call Trace: _raw_write_lock+0x71/0xd0 ksmbd_close_fd_app_instance_id+0xd9/0x670 [ksmbd] smb2_open+0x3e10/0xd910 [ksmbd] Freed by task 212: ksmbd_session_destroy+0x38d/0x480 [ksmbd] Fix this by looking the session up by opinfo->session_id. The lookup returns a reference, as smb2_break_collect_channels() does. Recheck that opinfo->sess still points at it before using it. Do the lookup without m_lock held. destroy_previous_session() takes m_lock under the session table lock, and taking them in the other order here would deadlock.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.2
|
7.3.2
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.2
|
7.4-rc1
|