Ad

CVE-2024-50200

MEDIUM CVSS 3.1: 5,5 EPSS 0.21%
Обновлено 4 августа 2026
Linux
Параметр Значение
CVSS 5,5 (MEDIUM)
Уязвимые версии 6.1 — 6.6.58
Устранено в версии 6.1.114
Поставщик Linux
Публичный эксплойт Нет

В ядре Linux устранена следующая уязвимость: Maple_tree: исправлено повреждение дерева в связующем хранилище. Серия патчей «maple_tree: исправлено повреждение дерева в связующем хранилище», v3. Появилась неприятная, но незаметная ошибка повреждения клена. существовать с момента создания алгоритма.

Эта ошибка кажется гораздо более вероятной после фиксации f8d112a4e657. («mm/mmap: избегать обнуления дерева vma в mmap_region()»), в этом суть после чего начали поступать отчеты об этой ошибке. Мы точно узнали об ошибке благодаря любезным усилиям Берт Карвацки, который очень помог мне отследить это. и определить причину этого. Ошибка возникает при попытке выполнить охватывающее сохранение через два листовых узла, где правый листовой узел является самым правым дочерним элементом общий родительский элемент, И хранилище полностью использует узел правого режима.

Это приводит к тому, что mas_wr_spanning_store() ошибочно дублирует новые и существующие записи на максимальной опорной точке в пределах диапазона и, следовательно, клен повреждение деревьев. Исправление исправляет это, обнаруживая этот сценарий и запрещая ошибочный дубликат. Сообщение о фиксации исправления подробно описывает, как это происходит.

В эту серию также входит тест, который достоверно воспроизводит проблему. утверждает, что исправление работает правильно. Берт любезно протестировал исправление и подтвердил, что оно решило его проблемы. Также Михаил Гаврилов любезно сообщил, что, похоже, то же самое. ошибка, которую это исправление также должно устранить.

Этот патч (из 2): В реализации кленового дерева была обнаружена незаметная ошибка. его зарождение. Это связано с тем, как выполняются сохранения: когда происходит сохранение, оно будет перезаписать перекрывающиеся диапазоны и при необходимости откорректировать дерево, чтобы приспособить это. В конечном итоге диапазон всегда может охватывать два конечных узла.

В этом случае мы пройтись по двум листовым узлам и определить, какие элементы не перезаписываются слева и справа от начала и конца диапазонов соответственно а затем перебалансировать дерево, чтобы оно содержало эти записи и новые вставил один. Этот тип хранилища называется «охватывающим хранилищем» и реализуется mas_wr_spanning_store(). Чтобы достичь этого этапа, mas_store_gfp() вызывает mas_wr_preallocate(), mas_wr_store_type() и mas_wr_walk() по очереди, чтобы пройдитесь по дереву и обновите объект (mas), чтобы перейти к месту куда должна выполняться запись, определяя тип ее хранилища.

Если требуется связующее хранилище, эта функция возвращает ложную остановку при родительский узел, содержащий целевой диапазон, и mas_wr_store_type() помечает mas->store_type как wr_spanning_store, чтобы обозначить этот факт. Когда мы собираемся выполнить сохранение в mas_wr_spanning_store(), мы сначала определить элементы ПОСЛЕ КОНЦА диапазона, который мы хотим сохранить (который находится справа от вставляемой записи) — мы делаем это, идя к СЛЕДУЮЩИЙ стержень в дереве (т. е. r_mas.last + 1), начиная с узла, который мы только что определили, содержит диапазон, в котором мы собираемся писать. Затем мы обращаем внимание на записи слева от записи, которую мы вставку, состояние которой представлено l_mas, и скопируйте их в «большой node', который представляет собой специальный узел, содержащий достаточно слотов для размещения двух ценность данных листового узла.

Затем мы копируем запись, которую хотим сохранить сразу после этого – копию и вставка новой записи выполняется с помощью mas_store_b_node(). После этого копируем элементы справа от конца диапазона, который вставляем, если не превысили длину узла (т. r_mas.offset <= r_mas.end). В этом и заключается ошибка — при очень специфических обстоятельствах эта логика может сломать и испортить клен.

Рассмотрим следующее дерево: Высота 0 Корневой узел / \ стержень = 0xffff / \ стержень = ULONG_MAX / ---усечено---

Показать оригинальное описание (EN)

In the Linux kernel, the following vulnerability has been resolved: maple_tree: correct tree corruption on spanning store Patch series "maple_tree: correct tree corruption on spanning store", v3. There has been a nasty yet subtle maple tree corruption bug that appears to have been in existence since the inception of the algorithm. This bug seems far more likely to happen since commit f8d112a4e657 ("mm/mmap: avoid zeroing vma tree in mmap_region()"), which is the point at which reports started to be submitted concerning this bug. We were made definitely aware of the bug thanks to the kind efforts of Bert Karwatzki who helped enormously in my being able to track this down and identify the cause of it. The bug arises when an attempt is made to perform a spanning store across two leaf nodes, where the right leaf node is the rightmost child of the shared parent, AND the store completely consumes the right-mode node. This results in mas_wr_spanning_store() mitakenly duplicating the new and existing entries at the maximum pivot within the range, and thus maple tree corruption. The fix patch corrects this by detecting this scenario and disallowing the mistaken duplicate copy. The fix patch commit message goes into great detail as to how this occurs. This series also includes a test which reliably reproduces the issue, and asserts that the fix works correctly. Bert has kindly tested the fix and confirmed it resolved his issues. Also Mikhail Gavrilov kindly reported what appears to be precisely the same bug, which this fix should also resolve. This patch (of 2): There has been a subtle bug present in the maple tree implementation from its inception. This arises from how stores are performed - when a store occurs, it will overwrite overlapping ranges and adjust the tree as necessary to accommodate this. A range may always ultimately span two leaf nodes. In this instance we walk the two leaf nodes, determine which elements are not overwritten to the left and to the right of the start and end of the ranges respectively and then rebalance the tree to contain these entries and the newly inserted one. This kind of store is dubbed a 'spanning store' and is implemented by mas_wr_spanning_store(). In order to reach this stage, mas_store_gfp() invokes mas_wr_preallocate(), mas_wr_store_type() and mas_wr_walk() in turn to walk the tree and update the object (mas) to traverse to the location where the write should be performed, determining its store type. When a spanning store is required, this function returns false stopping at the parent node which contains the target range, and mas_wr_store_type() marks the mas->store_type as wr_spanning_store to denote this fact. When we go to perform the store in mas_wr_spanning_store(), we first determine the elements AFTER the END of the range we wish to store (that is, to the right of the entry to be inserted) - we do this by walking to the NEXT pivot in the tree (i.e. r_mas.last + 1), starting at the node we have just determined contains the range over which we intend to write. We then turn our attention to the entries to the left of the entry we are inserting, whose state is represented by l_mas, and copy these into a 'big node', which is a special node which contains enough slots to contain two leaf node's worth of data. We then copy the entry we wish to store immediately after this - the copy and the insertion of the new entry is performed by mas_store_b_node(). After this we copy the elements to the right of the end of the range which we are inserting, if we have not exceeded the length of the node (i.e. r_mas.offset <= r_mas.end). Herein lies the bug - under very specific circumstances, this logic can break and corrupt the maple tree. Consider the following tree: Height 0 Root Node / \ pivot = 0xffff / \ pivot = ULONG_MAX / ---truncated---

Характеристики атаки

Способ атаки
Локальный
Нужен локальный доступ
Сложность
Низкая
Легко эксплуатировать
Нужны права
Низкие
Нужны базовые права
Участие пользователя
Не требуется
Не нужно действие пользователя

Последствия

Конфиденциальность
Нет
Нет утечки данных
Целостность
Нет
Нет модификации данных
Доступность
Высокое
Полный отказ в обслуживании

Строка CVSS v3.1

Уязвимые продукты 6

Конфигурация От (включительно) До (исключительно)
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.1 6.1.114
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.2 6.6.58
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.7 6.11.5
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.12:rc3:*:*:*:*:*:*
— —