[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025120823-CVE-2025-40319-9a46@gregkh>
Date: Mon, 8 Dec 2025 09:47:43 +0900
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-40319: bpf: Sync pending IRQ work before freeing ring buffer
From: Greg Kroah-Hartman <gregkh@...nel.org>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Sync pending IRQ work before freeing ring buffer
Fix a race where irq_work can be queued in bpf_ringbuf_commit()
but the ring buffer is freed before the work executes.
In the syzbot reproducer, a BPF program attached to sched_switch
triggers bpf_ringbuf_commit(), queuing an irq_work. If the ring buffer
is freed before this work executes, the irq_work thread may accesses
freed memory.
Calling `irq_work_sync(&rb->work)` ensures that all pending irq_work
complete before freeing the buffer.
The Linux kernel CVE team has assigned CVE-2025-40319 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 5.10.247 with commit 47626748a2a00068dbbd5836d19076637b4e235b
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 5.15.197 with commit de2ce6b14bc3e565708a39bdba3ef9162aeffc72
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 6.1.159 with commit e1828c7a8d8135e21ff6adaaa9458c32aae13b11
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 6.6.117 with commit 6451141103547f4efd774e912418a3b4318046c6
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 6.12.58 with commit 10ca3b2eec384628bc9f5d8190aed9427ad2dde6
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 6.17.8 with commit 430e15544f11f8de26b2b5109c7152f71b78295e
Issue introduced in 5.8 with commit 457f44363a8894135c85b7a9afd2bd8196db24ab and fixed in 6.18 with commit 4e9077638301816a7d73fa1e1b4c1db4a7e3b59c
Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to
older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-40319
will be updated if fixes are backported, please check that for the most
up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
kernel/bpf/ringbuf.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes. Individual
changes are never tested alone, but rather are part of a larger kernel
release. Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all. If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
https://git.kernel.org/stable/c/47626748a2a00068dbbd5836d19076637b4e235b
https://git.kernel.org/stable/c/de2ce6b14bc3e565708a39bdba3ef9162aeffc72
https://git.kernel.org/stable/c/e1828c7a8d8135e21ff6adaaa9458c32aae13b11
https://git.kernel.org/stable/c/6451141103547f4efd774e912418a3b4318046c6
https://git.kernel.org/stable/c/10ca3b2eec384628bc9f5d8190aed9427ad2dde6
https://git.kernel.org/stable/c/430e15544f11f8de26b2b5109c7152f71b78295e
https://git.kernel.org/stable/c/4e9077638301816a7d73fa1e1b4c1db4a7e3b59c
Powered by blists - more mailing lists