Skip to content
Medium 4.4

bpf, arm64: Fix racy plt target update in bpf_arch_text_poke()

CVE-2026-139451 First seen on SecPulse

Affected packages

PackageAffected → Fixed
LinuxLinux —
LinuxKernel
≥ 6.9.0, < 6.12.120→ 6.12.120
≥ 6.13.0, < 6.18.65→ 6.18.65
≥ 6.19.0, < 7.3.6→ 7.3.6

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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

bpf, arm64: Fix racy plt target update in bpf_arch_text_poke()

When a long-jump trampoline is attached to or detached from a bpf prog,
bpf_arch_text_poke() updates the plt target at the end of the prog by
temporarily making the page writable:

set_memory_rw(page);
WRITE_ONCE(plt->target, plt_target);
set_memory_ro(page);

Since commit 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory
management"), bpf progs are allocated from the bpf prog pack, so
unrelated progs and their plts commonly share a page. The sequence
above is not serialized against other pokers, it runs before text_mutex
is taken and callers only hold the lock of the trampoline being
updated. Two CPUs attaching to or detaching from different target progs
in the same page can therefore race:

CPU A                           CPU B
set_memory_rw(page)
                                set_memory_rw(page)
                                WRITE_ONCE(plt_B->target, ...)
                                set_memory_ro(page)
WRITE_ONCE(plt_A->target, ...)  <- permission fault

This was hit on an arm64 server with 64K pages while attaching fentry
programs to bpf progs:

Unable to handle kernel write to read-only memory at virtual address ffff80008f46d5f8
ESR = 0x000000009600004f
FSC = 0x0f: level 3 permission fault
pte=00c00200ea5a0783
Internal error: Oops: 000000009600004f [#1] SMP
pc : bpf_arch_text_poke+0x214/0x238
lr : bpf_a…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details