В ядре Linux устранена следующая уязвимость:
ipv6: учет fraggap на пути страничного распределения
В __ip6_append_data(), когда берется ветвь страничного распределения
(MSG_MORE / NETIF_F_SG / big fraglen), alloclen и pagedlen — это
рассчитано как
аллоклен = фрагхедерлен + трансхдрлен;
pagedlen = datalen - трансхдрлен;
datalen уже включает в себя фрагмент (datalen = длина + фрагмент). Когда
фраггап ненулевой, это не первый скб и трансхдрлен нулевой. Байты фрагмента, перенесенные из предыдущего skb, копируются сразу после
заголовки фрагментов в линейной области нового skb.
Линейная площадь
поэтому заниженный размер на байты fraggap, в то время как pagedlen завышен
ту же сумму, и копия записывает мимо skb->end в конечный
skb_shared_info. Непривилегированный пользователь может запустить это через сокет UDPv6, используя
MSG_MORE вместе с MSG_SPLICE_PAGES. Плохой учет был введен коммитом 773ba4fe9104 («ipv6:
избегайте частичного копирования для zc").
Перед фиксацией ce650a166335 ("udp6: Fix
Обработка __ip6_append_data() MSG_SPLICE_PAGES"), отрицательный
значение копии привело к возврату -EINVAL. Этот более поздний коммит позволил
MSG_SPLICE_PAGES, чтобы продолжить в этом случае, делая повреждение
триггерный. Невыгружаемая ветвь устанавливает для alloclen значение fraglen, что уже учитывает
для fraggap, потому что datalen это делает.
Приведите выгружаемую ветку в соответствие с помощью
добавление fraggap к alloclen и вычитание его из pagedlen. После этой корректировки копия больше не сворачивается в -fraggap на
постраничный путь, поэтому удалите устаревший комментарий, описывающий эту старую арифметику. Поскольку отрицательная копия больше не ожидается для действительного MSG_SPLICE_PAGES
В этом случае удалите исключение MSG_SPLICE_PAGES из проверки отрицательной копии.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ipv6: account for fraggap on the paged allocation path In __ip6_append_data(), when the paged-allocation branch is taken (MSG_MORE / NETIF_F_SG / large fraglen), alloclen and pagedlen are computed as alloclen = fragheaderlen + transhdrlen; pagedlen = datalen - transhdrlen; datalen already includes fraggap (datalen = length + fraggap). When fraggap is non-zero, this is not the first skb and transhdrlen is zero. The fraggap bytes carried over from the previous skb are copied just past the fragment headers in the new skb's linear area. The linear area is therefore undersized by fraggap bytes while pagedlen is overstated by the same amount, and the copy writes past skb->end into the trailing skb_shared_info. An unprivileged user can trigger this via a UDPv6 socket using MSG_MORE together with MSG_SPLICE_PAGES. The bad accounting was introduced by commit 773ba4fe9104 ("ipv6: avoid partial copy for zc"). Before commit ce650a166335 ("udp6: Fix __ip6_append_data()'s handling of MSG_SPLICE_PAGES"), the negative copy value caused -EINVAL to be returned. That later commit allowed MSG_SPLICE_PAGES to proceed in this case, making the corruption triggerable. The non-paged branch sets alloclen to fraglen, which already accounts for fraggap because datalen does. Bring the paged branch in line by adding fraggap to alloclen and subtracting it from pagedlen. After this adjustment, copy no longer collapses to -fraggap on the paged path, so remove the stale comment describing that old arithmetic. Since a negative copy is no longer expected for a valid MSG_SPLICE_PAGES case, remove the MSG_SPLICE_PAGES exception from the negative copy check.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.0
|
6.1.177
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.144
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.95
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.38
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.1.3
|