В ядре Linux устранена следующая уязвимость:
riscv: mm: исправлена проблема с выходом адреса vmemmap. В разреженной модели vmemmap виртуальный адрес vmemmap рассчитывается как:
((страница структуры *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)). И va страницы структуры можно вычислить со смещением:
(vmemmap + (pfn)).
Однако при инициализации страниц структуры ядро фактически запускается с
первая страница из того же раздела, к которому принадлежит phys_ram_base. Если
физический адрес первой страницы отсутствует (phys_ram_base >> PAGE_SHIFT), затем
мы получаем значение va ниже VMEMMAP_START при расчете va для страницы структуры. Например, если phys_ram_base начинается с 0x82000000 с pfn 0x82000,
первая страница в том же разделе на самом деле имеет номер pfn 0x80000.
Во время
init_unavailable_range(), мы инициализируем страницу структуры для pfn 0x80000.
с виртуальным адресом ((страница структуры *)VMEMMAP_START - 0x2000), который
ниже VMEMMAP_START, а также PCI_IO_END. Этот коммит исправляет эту ошибку, вводя новую переменную.
'vmemmap_start_pfn', который соответствует размеру раздела памяти и использует
он позволяет вычислить адрес vmemmap вместо phys_ram_base.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: riscv: mm: Fix the out of bound issue of vmemmap address In sparse vmemmap model, the virtual address of vmemmap is calculated as: ((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)). And the struct page's va can be calculated with an offset: (vmemmap + (pfn)). However, when initializing struct pages, kernel actually starts from the first page from the same section that phys_ram_base belongs to. If the first page's physical address is not (phys_ram_base >> PAGE_SHIFT), then we get an va below VMEMMAP_START when calculating va for it's struct page. For example, if phys_ram_base starts from 0x82000000 with pfn 0x82000, the first page in the same section is actually pfn 0x80000. During init_unavailable_range(), we will initialize struct page for pfn 0x80000 with virtual address ((struct page *)VMEMMAP_START - 0x2000), which is below VMEMMAP_START as well as PCI_IO_END. This commit fixes this bug by introducing a new variable 'vmemmap_start_pfn' which is aligned with memory section size and using it to calculate vmemmap address instead of phys_ram_base.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 14
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.10.212
|
5.11
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.15.151
|
5.16
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.1.81
|
6.1.140
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.6.21
|
6.6.72
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7.9
|
6.8
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.8.1
|
6.12.10
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.8:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.8:rc7:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.13:rc6:*:*:*:*:*:*
|
— | — |