Skip to contentSkip to conversation

CVE-2026-90247: bpf: Fix mmap_lock leak in irq_work path

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 17

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix mmap_lock leak in irq_work path

stack_map_get_build_id_offset() introduced a per-CPU irq_work to defer mmap_read_unlock() from NMI context, and bpf_find_vma() later reused the same mmap_unlock_work. Both callers only check whether the work is busy before taking mmap_lock, so a nested caller can reuse the slot before the first caller queues it. Two read locks may then be acquired while only one deferred unlock runs, leaking a read lock and blocking exit_mmap().

Reserve the per-CPU slot before mmap_read_trylock(). Use the same wrapper in stackmap and bpf_find_vma() so both callers release the reservation on trylock failure. Keep rejecting the slot while the irq_work remains busy. Release it after the irq_work callback unlocks the mm.

The Linux kernel CVE team has assigned CVE-2026-90247 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.5 with commit eac9153f2b584c702cea02c1f1a57d85aa9aea42 and fixed in 6.18.52 with commit a052ad5edccf5319f50ed955de4368f8318a9f20
	Issue introduced in 5.5 with commit eac9153f2b584c702cea02c1f1a57d85aa9aea42 and fixed in 7.2.6 with commit 051f2da26ce377f683b938a3382e0f16d02f3139
	Issue introduced in 5.5 with commit eac9153f2b584c702cea02c1f1a57d85aa9aea42 and fixed in 7.3-rc1 with commit fa9dcacdcdf487f0ffef64bf67622f1caed509f1
	Issue introduced in 4.19.92 with commit a7f4da875c16f3b8bef0d9ec67528111045bfcd8
	Issue introduced in 5.4.7 with commit f1838da73cccb238b8be4ef464fce0168dc7ba84

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-2026-90247

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/mmap_unlock_work.h
kernel/bpf/stackmap.c
kernel/bpf/task_iter.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/a052ad5edccf5319f50ed955de4368f8318a9f20
	https://git.kernel.org/stable/c/051f2da26ce377f683b938a3382e0f16d02f3139
	https://git.kernel.org/stable/c/fa9dcacdcdf487f0ffef64bf67622f1caed509f1