В ядре Linux устранена следующая уязвимость:
мм: не пытайтесь NUMA-мигрировать страницы COW, которые имеют другое применение. Одед Габбай сообщает, что включение балансировки NUMA приводит к повреждению
испытательная нагрузка ускорителя Гауди:
«Все детали в баге, но суть в том, что каким-то образом
этот патч вызывает повреждение, когда функция балансировки numa отключена.
включен И мы не используем привязку к процессам И используем GUP для закрепления страниц
поэтому наш ускоритель может осуществлять DMA в/из системной памяти. Либо отключение балансировки numa, либо использование привязки к процессу для привязки к
конкретный нума-узел или откат этого патча приводит к тому, что ошибка
исчезнуть"
и Одед разделил задачу пополам, зафиксировав 09854ba94c6a ("mm: do_wp_page()"
упрощение»).
Теперь балансировка NUMA на самом деле не должна изменять возможность записи.
страницы, и поэтому не должно иметь значения для COW. Но, похоже, это
делает. Подозрительный.
Однако независимо от этого условие включения ошибок NUMA в
Change_pte_range() бессмысленно. Он использует «page_mapcount(page)» для
решить, должна ли страница COW быть защищена NUMA или нет, и это делает
абсолютно никакого смысла. Количество сопоставлений на странице не имеет значения: GUP не только получает
ссылка на страницу, как в случае с Одедом, но другие сопоставления могут быть
выгружаются, и единственная ссылка на них будет в количестве страниц.
Поскольку мы никогда не должны пытаться сбалансировать NUMA страницу, которую мы не можем переместить.
в любом случае из-за других ссылок просто исправьте код, чтобы использовать «page_count()». Одед подтверждает, что это решает его проблему. Это означает, что что-то в балансировке NUMA в конечном итоге изменится.
средства защиты страницы (кроме очевидной защиты страницы
недоступен для получения информации о сбоях NUMA).
В противном случае КОРОВА упрощение не имело бы значения, поскольку выполнение GUP на странице убедитесь, что он доступен для записи. Причину этого изменения разрешения тоже было бы полезно выяснить, поскольку это явно приводит к ложным событиям COW, но исправление бессмысленный тест, который только что сработал раньше, очевидно, является CorrectThing(tm) делать в любом случае.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: mm: don't try to NUMA-migrate COW pages that have other uses Oded Gabbay reports that enabling NUMA balancing causes corruption with his Gaudi accelerator test load: "All the details are in the bug, but the bottom line is that somehow, this patch causes corruption when the numa balancing feature is enabled AND we don't use process affinity AND we use GUP to pin pages so our accelerator can DMA to/from system memory. Either disabling numa balancing, using process affinity to bind to specific numa-node or reverting this patch causes the bug to disappear" and Oded bisected the issue to commit 09854ba94c6a ("mm: do_wp_page() simplification"). Now, the NUMA balancing shouldn't actually be changing the writability of a page, and as such shouldn't matter for COW. But it appears it does. Suspicious. However, regardless of that, the condition for enabling NUMA faults in change_pte_range() is nonsensical. It uses "page_mapcount(page)" to decide if a COW page should be NUMA-protected or not, and that makes absolutely no sense. The number of mappings a page has is irrelevant: not only does GUP get a reference to a page as in Oded's case, but the other mappings migth be paged out and the only reference to them would be in the page count. Since we should never try to NUMA-balance a page that we can't move anyway due to other references, just fix the code to use 'page_count()'. Oded confirms that that fixes his issue. Now, this does imply that something in NUMA balancing ends up changing page protections (other than the obvious one of making the page inaccessible to get the NUMA faulting information). Otherwise the COW simplification wouldn't matter - since doing the GUP on the page would make sure it's writable. The cause of that permission change would be good to figure out too, since it clearly results in spurious COW events - but fixing the nonsensical test that just happened to work before is obviously the CorrectThing(tm) to do regardless.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 13
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.9.1
|
5.10.102
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.25
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
5.16.11
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:rc7:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.9:rc8:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:5.17:rc4:*:*:*:*:*:*
|
— | — |