Перейти к содержимому
Noroxi
CVE-2024-41009· NVD / CVE Program· CNA Linux

bpf: Fix overrunning reservations in ringbuf

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix overrunning reservations in ringbuf The BPF ring buffer internally is implemented as a power-of-2 sized circular buffer, with two logical and ever-increasing counters: consumer_pos is the consumer counter to show which logical position the consumer consumed the data, and producer_pos which is the producer counter denoting the amount of data reserved by all producers. Each time a record is reserved, the producer that "owns" the record will successfully advance producer counter. In user space each time a record is read, the consumer of the data advanced the consumer counter once it finished processing. Both counters are stored in separate pages so that from user space, the producer counter is read-only and the consumer counter is read-write. One aspect that simplifies and thus speeds up the implementation of both producers and consumers is how the data area is mapped twice contiguously back-to-back in the virtual memory, allowing to not take any special measures for samples that have to wrap around at the end of the circular buffer data area, because the next page after the last data page would be first data page again, and thus the sample will still appear completely contiguous in virtual memory. Each record has a struct bpf_ringbuf_hdr { u32 len; u32 pg_off; } header for book-keeping the length and offset, and is inaccessible to the BPF program. Helpers like bpf_ringbuf_reserve() return `(void *)hdr + BPF_RINGBUF_HDR_SZ` for the BPF program to use. Bing-Jhong and Muhammad reported that it is however possible to make a second allocated memory chunk overlapping with the first chunk and as a result, the BPF program is now able to edit first chunk's header. For example, consider the creation of a BPF_MAP_TYPE_RINGBUF map with size of 0x4000. Next, the consumer_pos is modified to 0x3000 /before/ a call to bpf_ringbuf_reserve() is made. This will allocate a chunk A, which is in [0x0,0x3008], and the BPF program is able to edit [0x8,0x3008]. Now, lets allocate a chunk B with size 0x3000. This will succeed because consumer_pos was edited ahead of time to pass the `new_prod_pos - cons_pos > rb->mask` check. Chunk B will be in range [0x3008,0x6010], and the BPF program is able to edit [0x3010,0x6010]. Due to the ring buffer memory layout mentioned earlier, the ranges [0x0,0x4000] and [0x4000,0x8000] point to the same data pages. This means that chunk B at [0x4000,0x4008] is chunk A's header. bpf_ringbuf_submit() / bpf_ringbuf_discard() use the header's pg_off to then locate the bpf_ringbuf itself via bpf_ringbuf_restore_from_rec(). Once chunk B modified chunk A's header, then bpf_ringbuf_commit() refers to the wrong page and could cause a crash. Fix it by calculating the oldest pending_pos and check whether the range from the oldest outstanding record to the newest would span beyond the ring buffer size. If that is the case, then reject the request. We've tested with the ring buffer benchmark in BPF selftests (./benchs/run_bench_ringbufs.sh) before/after the fix and while it seems a bit slower on some benchmarks, it is still not significantly enough to matter.

СредняяCVSS 5.5 · v3.1—Эксплойта нет Есть исправление
Опубликовано
17 июл. 2024 г.
Обновлено
5 авг. 2026 г.
EPSS
0,3 % · 18-й процентиль
Следить за этой CVE

Войдите, чтобы следить · Вы получите уведомление, если запись попадёт в KEV, получит эксплойт или обновится.

Инструменты для отчёта

JSON

Оценка срочности

22

Наблюдать

Пока низкий приоритет.

CVSS
22 / 40 · 5.5 / 10
CISA KEV
0 / 30 · Нет в списке
EPSS
0 / 30 · 0,3 %

Решение CISA SSVC

Эксплуатация
нет
Автоматизируемо
нет
Техническое влияние
частичное

Vulnrichment: входные данные дерева решений CISA.

Оценка CNA и NVD

NVD
5,5
CNA · Linux
7,8
разница 2,3 балла

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Оценка присваивающего органа и независимая оценка NVD. Разрыв означает, что критичность спорна.

Затронутые системы

ВендорПродукт
linuxlinux kernel

Затронутые версии

Диапазоны версий NVD (для продуктов из каталога). Добавьте продукт в стек с версией, и сопоставление будет по ним.

  • linux linux kernel5.8 и новее · до 6.1.97
  • linux linux kernel6.2 и новее · до 6.6.37
  • linux linux kernel6.7 и новее · до 6.9.8

Версии, заявленные вендором

Диапазоны затронутых версий, заявленные назначающей организацией (Linux). Не зависят от анализа CPE в NVD и обычно опережают его.

  • Linux Linux

    • 5.8затронута
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до be35504b959f2749bab280f4671e8df96dcf836fзатронута · git
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до 0f98f40eb1ed52af8b81f61901b6c0289ff59de4затронута · git
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до d1b9df0435bc61e0b44f578846516df8ef476686затронута · git
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до 511804ab701c0503b72eac08217eabfd366ba069затронута · git
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до 47416c852f2a04d348ea66ee451cbdcf8119f225затронута · git
    • 457f44363a8894135c85b7a9afd2bd8196db24ab и новее · до cfa1a2329a691ffd991fcf7248a57d752e712881затронута · git
    • до 5.8не затронута · semver
    • 5.10.223 и новее · до 5.10.* включительноне затронута · semver
    • 5.15.164 и новее · до 5.15.* включительноне затронута · semver

Затронутые пакеты

Данные OSV и GitHub Advisory: экосистема, пакет и диапазон. Сопоставление SBOM использует эту таблицу.

ЭкосистемаПакетЗатронутый диапазонИсправление
AlmaLinux:9bpftoolдо 7.4.0-503.15.1.el9_57.4.0-503.15.1.el9_5
AlmaLinux:9kernelдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64kдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debugдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-develдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-devel-matchedдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-modulesдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-modules-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-debug-modules-extraдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-develдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-devel-matchedдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-modulesдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-modules-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-64k-modules-extraдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-abi-stablelistsдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-cross-headersдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-debugдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-debug-coreдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-debug-develдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-debug-devel-matchedдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5
AlmaLinux:9kernel-debug-modulesдо 5.14.0-503.15.1.el9_55.14.0-503.15.1.el9_5

+96

Тот же продукт

linux: все записи

Другие записи с наивысшей оценкой для того же основного продукта.

  • CVE-2022-0847A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe KEV
    89Срочно
  • CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV
    85Срочно
  • CVE-2016-5195Race condition in mm/gup.c in the Linux kernel 2.x through 4.x before 4.8.3 allows local users to gain privileges by leveraging incorrect haKEV
    83Срочно
  • CVE-2019-13272In the Linux kernel before 5.1.17, ptrace_link in kernel/ptrace.c mishandles the recording of the credentials of a process that wants to creKEV
    77На этой неделе
  • CVE-2013-6282The (1) get_user and (2) put_user API functions in the Linux kernel before 3.5.5 on the v6k and v7 ARM platforms do not validate certain addKEV
    77На этой неделе
  • CVE-2013-2094The perf_swevent_init function in kernel/events/core.c in the Linux kernel before 3.8.9 uses an incorrect integer data type, which allows loKEV
    77На этой неделе

Исправление

На какую версию обновиться

Версии с исправлением по данным вендора, реестров пакетов и Microsoft. Перед обновлением сверьтесь с бюллетенем вендора.

Продукт / пакетИсправленная версияИсточник
Linux Linux0f98f40eb1ed52af8b81f61901b6c0289ff59de4Вендор (CNA)
Linux Linux47416c852f2a04d348ea66ee451cbdcf8119f225Вендор (CNA)
Linux Linux511804ab701c0503b72eac08217eabfd366ba069Вендор (CNA)
Linux Linuxbe35504b959f2749bab280f4671e8df96dcf836fВендор (CNA)
Linux Linuxcfa1a2329a691ffd991fcf7248a57d752e712881Вендор (CNA)
Linux Linuxd1b9df0435bc61e0b44f578846516df8ef476686Вендор (CNA)
almalinux:bpftool7.4.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-core5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-core5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-devel5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-devel-matched5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-modules5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-modules-core5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-debug-modules-extra5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
almalinux:kernel-64k-devel5.14.0-503.15.1.el9_5 · AlmaLinux:9Реестр пакетов (OSV)
debian:linux6.1.98-1 · Debian:12Реестр пакетов (OSV)
red hat:bpftool0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:bpftool-debuginfo0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-abi-stablelists0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-core0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug-core0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug-debuginfo0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug-devel0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug-modules0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)
red hat:kernel-debug-modules-extra0:4.18.0-477.81.1.el8_8 · Red Hat:rhel_eus:8.8::baseosРеестр пакетов (OSV)

+1

Статус эксплойта

Публичный эксплойт неизвестен

Публичный эксплойт пока не обнаружен. Это не значит, что вы в безопасности, лишь что порог чуть выше.

Контекст для исследователя

Для пентестеров и исследователей: профиль атаки, расхождение оценок, хронология, коммиты исправлений, авторы, кандидаты в варианты и цепочки, охват bug bounty. Всё выводится из имеющихся данных; без кода эксплойтов.

Хронология

От публикации до сегодня: proof of concept, модуль Metasploit, CISA KEV и запись об исправлении. Даты — как сообщают источники.

Кроме публикации датированных событий нет.

EPSS за 120 дней

Ежедневная оценка FIRST EPSS; записываются только изменения от 0,01 (ступенчатый график).

Ссылки на патчи и коммиты

Коммиты, PR и diff среди источников. Отправная точка для patch-diff и поиска вариантов; это исправления, не эксплойты.

Среди источников нет ссылок на коммит или PR.

Нашедшие, сообщившие и аналитики, названные в записи CNA. Нажмите имя, чтобы увидеть другие записи исследователя.

В записи CNA нет авторов.

Кандидаты в варианты

Тот же продукт, тот же класс уязвимости, в пределах 18 месяцев. Если патч не закрыл первопричину, родственная ошибка здесь.

  • CVE-2021-47137с разницей 114 дн.net: lantiq: fix memory corruption in RX ring
    39Наблюдать
  • CVE-2024-35969с разницей 58 дн.ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr
    35Наблюдать
  • CVE-2024-34027с разницей 23 дн.f2fs: compress: fix to cover {reserve,release}_compress_blocks() w/ cp_rwsem lock
    31Наблюдать
  • CVE-2021-47551с разницей 54 дн.drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again
    31Наблюдать
  • CVE-2021-47130с разницей 124 дн.nvmet: fix freeing unallocated p2pmem
    30Наблюдать
  • CVE-2024-26894с разницей 91 дн.ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()
    24Наблюдать

Кандидаты в цепочки

Обход аутентификации и уязвимость, требующая привилегий, в одном продукте и близко по времени: вместе они могут дать путь без аутентификации.

—

Охват bug bounty

Известной публичной программы нет.

Источник: bounty-targets-data (публичные списки HackerOne, Bugcrowd, Intigriti, YesWeHack).

Технические детали

Условия атаки

  • Может быть вызвана пользователем с локальным доступом к системе.
  • Достаточно учётной записи с низкими привилегиями.
  • Действия пользователя не требуются.
  • Особые условия не требуются; воспроизводится стабильно.

В случае успеха

Конфиденциальность
нет
Целостность
нет
Доступность
высокое · работа сервиса может быть нарушена
Вектор атаки
Локальный
Сложность атаки
Низкая
Требуемые привилегии
Низкие
Взаимодействие с пользователем
Не требуется
Область действия
Не изменяется
Влияние на конфиденциальность
Нет
Влияние на целостность
Нет
Влияние на доступность
Высокое

Вектор CVSS

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

nvd-primary

Анализ Noroxi

Анализа Noroxi для этой записи пока нет

Мы не пишем анализ вручную для всех 385 000+ уязвимостей; это было бы нечестно. Для значимых уязвимостей с реальным влиянием наша команда описывает механизм, обнаружение и устранение.

Мы используем этот продукт, нужна помощь

Журнал изменений

  1. Исправление✗ → ✓

Для отслеживаемых записей эти изменения приходят и как уведомления. →

Источники

Все записи