Ad

CVE-2025-39945

HIGH CVSS 3.1: 7,8 EPSS 0.16%
Обновлено 20 октября 2026
Linux
Параметр Значение
CVSS 7,8 (HIGH)
Уязвимые версии 2.6.37 — 6.6.108
Устранено в версии 5.4.300
Тип уязвимости CWE-416 (Использование памяти после освобождения)
Поставщик Linux
Публичный эксплойт Нет

В ядре Linux устранена следующая уязвимость: cnic: исправлены ошибки использования после освобождения в cnic_delete_task. Исходный код использует cancel_delayed_work() в cnic_cm_stop_bnx2x_hw(), что не гарантирует, что отложенный рабочий элемент «delete_task» имеет полностью завершено, если оно уже запущено. Кроме того, задержка в работе элемент циклический, методlush_workqueue() только в cnic_cm_stop_bnx2x_hw() блокирует и ожидает рабочие элементы, которые уже были поставлены в очередь на workqueue до его вызова.

Любые рабочие элементы, представленные после lush_workqueue() не включены в набор задач, которые выполняет Ожидается операция промывки. Это означает, что после завершения циклических рабочих элементов завершено, отложенный рабочий элемент может все еще существовать в рабочей очереди. Это приводит к сценариям использования после освобождения, в которых cnic_dev освобождается. с помощью cnic_free_dev(), в то время как delete_task остается активным и пытается разыменование cnic_dev в cnic_delete_task().

Типичное состояние гонки показано ниже: ЦП 0 (очистка) | ЦП 1 (обратный вызов с задержкой работы) cnic_netdev_event() | cnic_stop_hw() | cnic_delete_task() cnic_cm_stop_bnx2x_hw() | ... cancel_delayed_work() | /* очередь_delayed_work() flash_workqueue() | выполняется после flash_workqueue()*/ | очередь_delayed_work() cnic_free_dev(dev)//бесплатно | cnic_delete_task() //новый экземпляр | dev = CP->dev; //использовать Замените cancel_delayed_work() на cancel_delayed_work_sync(), чтобы гарантировать что циклически отложенный рабочий элемент правильно отменен и что все текущее выполнение рабочего элемента завершается до того, как cnic_dev будет освобожден. Более того, поскольку cancel_delayed_work_sync() использует __flush_work(work, true) для синхронного ожидания любого текущего выполнение экземпляра рабочего элемента для завершения, методlush_workqueue() становится лишним и его следует удалить. Эта ошибка была обнаружена посредством статического анализа.

Чтобы воспроизвести проблему и проверить исправление, я смоделировал устройство cnic PCI в QEMU и введены преднамеренные задержки — например, при вставке вызовов ssleep() внутри функции cnic_delete_task() — чтобы повысить вероятность запуска ошибки.

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

In the Linux kernel, the following vulnerability has been resolved: cnic: Fix use-after-free bugs in cnic_delete_task The original code uses cancel_delayed_work() in cnic_cm_stop_bnx2x_hw(), which does not guarantee that the delayed work item 'delete_task' has fully completed if it was already running. Additionally, the delayed work item is cyclic, the flush_workqueue() in cnic_cm_stop_bnx2x_hw() only blocks and waits for work items that were already queued to the workqueue prior to its invocation. Any work items submitted after flush_workqueue() is called are not included in the set of tasks that the flush operation awaits. This means that after the cyclic work items have finished executing, a delayed work item may still exist in the workqueue. This leads to use-after-free scenarios where the cnic_dev is deallocated by cnic_free_dev(), while delete_task remains active and attempt to dereference cnic_dev in cnic_delete_task(). A typical race condition is illustrated below: CPU 0 (cleanup) | CPU 1 (delayed work callback) cnic_netdev_event() | cnic_stop_hw() | cnic_delete_task() cnic_cm_stop_bnx2x_hw() | ... cancel_delayed_work() | /* the queue_delayed_work() flush_workqueue() | executes after flush_workqueue()*/ | queue_delayed_work() cnic_free_dev(dev)//free | cnic_delete_task() //new instance | dev = cp->dev; //use Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the cyclic delayed work item is properly canceled and that any ongoing execution of the work item completes before the cnic_dev is deallocated. Furthermore, since cancel_delayed_work_sync() uses __flush_work(work, true) to synchronously wait for any currently executing instance of the work item to finish, the flush_workqueue() becomes redundant and should be removed. This bug was identified through static analysis. To reproduce the issue and validate the fix, I simulated the cnic PCI device in QEMU and introduced intentional delays — such as inserting calls to ssleep() within the cnic_delete_task() function — to increase the likelihood of triggering the bug.

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

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

Последствия

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

Строка CVSS v3.1

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

Конфигурация От (включительно) До (исключительно)
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
2.6.37 5.4.300
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
5.5 5.10.245
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
5.11 5.15.194
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
5.16 6.1.154
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.2 6.6.108
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.7 6.12.49
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
6.13 6.16.9
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*
— —
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:rc6:*:*:*:*:*:*
— —