В ядре Linux устранена следующая уязвимость:
sctp: очистить очередь при устаревшей обработке COOKIE-ECHO
sctp_stream_update() вызывается только тогда, когда ассоциация перемещается в
COOKIE_WAIT во время установки/реконфигурации ассоциации. На этом пути
Ожидается, что состояние планировщика исходящего потока (stream->out_curr) будет
чистый, поскольку никакие пользовательские данные еще не должны были передаваться, если только
государственная машина уже частично продвинулась. Однако в sctp_sf_do_5_2_6_stale() существует крайний случай: когда
Получена ошибка Stale Cookie ERROR, ассоциация откатывается от
COOKIE_ECHOED на COOKIE_WAIT.
В этом сценарии пользовательские данные могут уже
были поставлены в очередь и даже объединены с куском COOKIE-ECHO. Во время отката sctp_stream_update() освобождает старую таблицу потоков.
и устанавливает новый, но не делает поток поток->out_curr недействительным. В результате out_curr все еще может указывать на освобожденный sctp_stream_out.
вход из предыдущего состояния потока.
Позже пути удаления из очереди планировщика SCTP (FCFS, RR, PRIO и т. д.) основаны на
поток->out_curr->ext, что может привести к использованию после освобождения, как только старый
состояние потока было освобождено через sctp_stream_free(). Это приводит к таким сбоям (сообщил Yuqi):
ОШИБКА: KASAN: slab-use-after-free в sctp_sched_fcfs_dequeue+0x13a/0x140
Чтение размера 8 по адресу ff1100004d4d3208 с помощью задачи mini_poc/9312. ЦП: 1 UID: 1001 PID: 9312 Связь: mini_poc Не испорчено
7.1.0-rc1-00305-gbd3a4795d574 #5 ПРЕДВАРИТЕЛЬНЫЙ (полный)
sctp_sched_fcfs_dequeue+0x13a/0x140
sctp_outq_flush+0x1603/0x33e0
sctp_do_sm+0x31c9/0x5d30
sctp_assoc_bh_rcv+0x392/0x6f0
sctp_inq_push+0x1db/0x270
sctp_rcv+0x138d/0x3c10
Исправьте это, полностью очистив выходную очередь ассоциации при обработке
Дело об устаревшем печенье.
Это гарантирует, что все ожидающие передачи и повторные передачи
состояние удаляется, и все кэшированные указатели планировщика становятся недействительными,
делая безопасным восстановление состояния потока во время перезапуска COOKIE_WAIT. Обновление только потока->out_curr было бы недостаточным, поскольку в очереди
и повторно передаваемые данные по-прежнему будут ссылаться на старое состояние потока и
запускать позднее использование после освобождения в путях удаления из очереди.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: sctp: purge outqueue on stale COOKIE-ECHO handling sctp_stream_update() is only invoked when the association is moved into COOKIE_WAIT during association setup/reconfiguration. In this path, the outbound stream scheduler state (stream->out_curr) is expected to be clean, since no user data should have been transmitted yet unless the state machine has already partially progressed. However, a corner case exists in sctp_sf_do_5_2_6_stale(): when a Stale Cookie ERROR is received, the association is rolled back from COOKIE_ECHOED to COOKIE_WAIT. In this scenario, user data may already have been queued and even bundled with the COOKIE-ECHO chunk. During the rollback, sctp_stream_update() frees the old stream table and installs a new one, but it does not invalidate stream->out_curr. As a result, out_curr may still point to a freed sctp_stream_out entry from the previous stream state. Later, SCTP scheduler dequeue paths (FCFS, RR, PRIO, etc.) rely on stream->out_curr->ext, which can lead to use-after-free once the old stream state has been released via sctp_stream_free(). This results in crashes such as (reported by Yuqi): BUG: KASAN: slab-use-after-free in sctp_sched_fcfs_dequeue+0x13a/0x140 Read of size 8 at addr ff1100004d4d3208 by task mini_poc/9312 CPU: 1 UID: 1001 PID: 9312 Comm: mini_poc Not tainted 7.1.0-rc1-00305-gbd3a4795d574 #5 PREEMPT(full) sctp_sched_fcfs_dequeue+0x13a/0x140 sctp_outq_flush+0x1603/0x33e0 sctp_do_sm+0x31c9/0x5d30 sctp_assoc_bh_rcv+0x392/0x6f0 sctp_inq_push+0x1db/0x270 sctp_rcv+0x138d/0x3c10 Fix this by fully purging the association outqueue when handling the Stale Cookie case. This ensures all pending transmit and retransmit state is dropped, and any scheduler cached pointers are invalidated, making it safe to rebuild stream state during COOKIE_WAIT restart. Updating only stream->out_curr would be insufficient, since queued and retransmittable data would still reference the old stream state and trigger later use-after-free in dequeue paths.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 13
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
4.15
|
5.10.259
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.210
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.176
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.143
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.94
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.36
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc6:*:*:*:*:*:*
|
— | — |