В ядре Linux устранена следующая уязвимость:
Tipc: исправлено чтение за пределами границ широковещательных блоков Gap ACK. Широковещательная рассылка PROTOCOL/STATE_MSG может содержать запись блоков Gap ACK в своем
область данных. Tipc_get_gap_ack_blks() только проверяет, что длина записи
поле самосогласовано со своими счетчиками ugack_cnt/bgack_cnt
(sz == struct_size(p, gacks, ugack_cnt + bgack_cnt)); это не проверяет
что запись действительно помещается в область данных сообщения msg_data_sz(). Одноадресный вызывающий абонент Tipc_link_proto_rcv() ограничивает его («if (glen > dlen)
Break;"), но широковещательный вызывающий метод Tipc_bcast_sync_rcv() отбрасывает
возвращаемый размер, поэтому Tipc_link_advance_transmq() копирует запись из
получить skb с подконтрольным злоумышленнику счетчиком:
this_ga = kmemdup(ga, struct_size(ga, gacks, ga->bgack_cnt),
GFP_ATOMIC);
Сосед TIPC, который согласовал TIPC_GAP_ACK_BLOCK, запускает его с помощью одного
обычная трансляция STATE_MSG (msg_bc_ack_invalid() Clear), размер которой соответствует
область данных короткая, содержит запись Gap ACK с len = 0x400,
bgack_cnt = 0xff и ugack_cnt = 0.
Тогда длина равна
struct_size(p, gacks, 255), поэтому проверка согласованности проходит и ga становится
не NULL; kmemdup() считывает struct_size(ga, gacks, 255) = 1024 байта
из гораздо меньшего скб:
ОШИБКА: KASAN: плита выходит за пределы поля в kmemdup_noprof+0x48/0x60. Чтение размера 1024 по адресу ffff0000c7030d38 с помощью задачи poc864/69. Трассировка звонков:
kmemdup_noprof+0x48/0x60
Tipc_link_advance_transmq+0x86c/0xb80
Tipc_link_bc_ack_rcv+0x19c/0x1e0
Tipc_bcast_sync_rcv+0x1c4/0x2c4
Tipc_rcv+0x85c/0x1340
Tipc_l2_rcv_msg+0xac/0x104
Адрес ошибки принадлежит объекту по адресу ffff0000c7030d00.
который принадлежит кэшу skbuff_small_head размером 704
Адрес ошибки находится в 56 байтах внутри
выделенная 704-байтовая область [ffff0000c7030d00, ffff0000c7030fc0)
Скопированные байты впоследствии используются как значения пропуска/подтверждения, но
чтение уже выходит за пределы kmemdup(), независимо от того, как
они используются.
Одноадресный путь STATE отбрасывает такое сообщение: «if (glen > dlen) Break;»
пропускает остальную часть обработки STATE_MSG, и skb освобождается. Сделайте
путь трансляции тоже отбросьте. Tipc_bcast_sync_rcv() теперь ограничивает запись
против msg_data_sz() и, если он не подходит, сообщает об этом обратно через
Tipc_node_bc_sync_rcv() в Tipc_rcv(), поэтому skb отбрасывается, а не
обработано. ga не очищается на этом пути: ga == NULL уже означает
«устаревший одноранговый узел без селективного подтверждения», отдельное легитимное состояние.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: tipc: fix out-of-bounds read in broadcast Gap ACK blocks A broadcast PROTOCOL/STATE_MSG can carry a Gap ACK blocks record in its data area. tipc_get_gap_ack_blks() only verifies that the record's len field is self-consistent with its ugack_cnt/bgack_cnt counts (sz == struct_size(p, gacks, ugack_cnt + bgack_cnt)); it does not check that the record actually fits in the message data area, msg_data_sz(). The unicast caller tipc_link_proto_rcv() bounds it ("if (glen > dlen) break;"), but the broadcast caller tipc_bcast_sync_rcv() discards the returned size, so tipc_link_advance_transmq() copies the record off the receive skb with an attacker-controlled count: this_ga = kmemdup(ga, struct_size(ga, gacks, ga->bgack_cnt), GFP_ATOMIC); A TIPC neighbour that negotiated TIPC_GAP_ACK_BLOCK triggers it with one ordinary broadcast STATE_MSG (msg_bc_ack_invalid() clear), sized so its data area is short, carrying a Gap ACK record with len = 0x400, bgack_cnt = 0xff and ugack_cnt = 0. len then equals struct_size(p, gacks, 255), so the consistency check passes and ga is non-NULL; kmemdup() reads struct_size(ga, gacks, 255) = 1024 bytes out of the much smaller skb: BUG: KASAN: slab-out-of-bounds in kmemdup_noprof+0x48/0x60 Read of size 1024 at addr ffff0000c7030d38 by task poc864/69 Call trace: kmemdup_noprof+0x48/0x60 tipc_link_advance_transmq+0x86c/0xb80 tipc_link_bc_ack_rcv+0x19c/0x1e0 tipc_bcast_sync_rcv+0x1c4/0x2c4 tipc_rcv+0x85c/0x1340 tipc_l2_rcv_msg+0xac/0x104 The buggy address belongs to the object at ffff0000c7030d00 which belongs to the cache skbuff_small_head of size 704 The buggy address is located 56 bytes inside of allocated 704-byte region [ffff0000c7030d00, ffff0000c7030fc0) The copied-out bytes are subsequently consumed as gap/ack values, but the read is already out of bounds at the kmemdup() regardless of how they are used. The unicast STATE path drops such a message: "if (glen > dlen) break;" skips the rest of STATE_MSG handling and the skb is freed. Make the broadcast path drop it too. tipc_bcast_sync_rcv() now bounds the record against msg_data_sz() and, when it does not fit, reports it back through tipc_node_bc_sync_rcv() to tipc_rcv() so the skb is discarded rather than processed. ga is not cleared on this path: ga == NULL already means "legacy peer without Selective ACK", a distinct legitimate state.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.8
|
5.10.261
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.212
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.178
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.145
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.96
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.39
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.1.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.2:rc1:*:*:*:*:*:*
|
— | — |