bpf: Sync pending IRQ work before freeing ring buffer
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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.247, 5.15.197, 6.1.159, 6.12.58, 6.17.8, 6.6.117
- CVEs
- CVE-2025-40319
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 01:54 UTC · Revision 1
Source evidence
bpf: Sync pending IRQ work before freeing ring buffer
core-osv · Original sourcePublished 8 Dec 2025, 00:46 UTC
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.
osv:CVE-2025-40319
Kernel
Fixed versions: 5.10.247, 5.15.197, 6.1.159, 6.6.117, 6.12.58, 6.17.8
Complete source record
{
"id": "3e00f7744b7ec81b60047ac2ec20b2a3e73a10a836bbf24e58fe4ba026f44f1f",
"url": "https://osv.dev/vulnerability/CVE-2025-40319",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "bpf: Sync pending IRQ work before freeing ring buffer",
"summary": "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.",
"evidence": "osv:CVE-2025-40319",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.10.247",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.197",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.159",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.117",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.58",
"evidence": "/affected/1/ranges"
},
{
"value": "6.17.8",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2025-40319",
"aliases": [
"CVE-2025-40319"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "457f44363a8894135c85b7a9afd2bd8196db24ab"
},
{
"fixed": "47626748a2a00068dbbd5836d19076637b4e235b"
},
{
"fixed": "de2ce6b14bc3e565708a39bdba3ef9162aeffc72"
},
{
"fixed": "e1828c7a8d8135e21ff6adaaa9458c32aae13b11"
},
{
"fixed": "6451141103547f4efd774e912418a3b4318046c6"
},
{
"fixed": "10ca3b2eec384628bc9f5d8190aed9427ad2dde6"
},
{
"fixed": "430e15544f11f8de26b2b5109c7152f71b78295e"
},
{
"fixed": "4e9077638301816a7d73fa1e1b4c1db4a7e3b59c"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40319.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.8.0"
},
{
"fixed": "5.10.247"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.197"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.159"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.117"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.58"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.17.8"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40319.json"
}
}
],
"modified": "2026-10-28T02:30:25.335413330Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/10ca3b2eec384628bc9f5d8190aed9427ad2dde6",
"https://git.kernel.org/stable/c/430e15544f11f8de26b2b5109c7152f71b78295e",
"https://git.kernel.org/stable/c/47626748a2a00068dbbd5836d19076637b4e235b",
"https://git.kernel.org/stable/c/4e9077638301816a7d73fa1e1b4c1db4a7e3b59c",
"https://git.kernel.org/stable/c/6451141103547f4efd774e912418a3b4318046c6",
"https://git.kernel.org/stable/c/de2ce6b14bc3e565708a39bdba3ef9162aeffc72",
"https://git.kernel.org/stable/c/e1828c7a8d8135e21ff6adaaa9458c32aae13b11",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40319.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-40319",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40319.json"
}
},
"related_cves": [
{
"value": "CVE-2025-40319",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 491732,
"published_at": "2025-12-08T00:46:46.448+00:00"
}