CVE-2026-139451: bpf, arm64: Fix racy plt target update in bpf_arch_text_poke()

Published Nov 30, 2026
·
Updated

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

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

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

setmemoryrw(page); WRITEONCE(plt->target, plttarget); setmemoryro(page);

Since commit 1dad391daef1 ("bpf, arm64: use bpfprogpack 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 textmutex 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 setmemoryrw(page) setmemoryrw(page) WRITEONCE(pltB->target, ...) setmemoryro(page) WRITEONCE(pltA->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 : bpfarchtextpoke+0x214/0x238 lr : bpfarchtextpoke+0x200/0x238 Call trace: bpfarchtextpoke+0x214/0x238 (P) bpftrampolinelinkprog+0x1c8/0x470 bpftrampolinelinkprog+0x64/0x90 bpftracingprogattach+0x318/0x4a8 bpfrawtplinkattach+0x104/0x258 bpfrawtracepointopen+0x6c/0x90 sysbpf+0x134c/0x3e10

Rather than serializing the permission changes, stop changing page permissions altogether and write the plt target with aarch64insnwriteliteralu64(). It writes through the text patching fixmap under patchlock, the same way the rest of the prog pack is written, and performs a single-copy atomic 64-bit store. The plt target is naturally aligned (see buildplt()), so CPUs concurrently executing the plt still observe either the old or the new target. This is the same helper ftrace and static calls use to update 64-bit literals that are loaded concurrently.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
Description

Frequently Asked Questions

1

Which systems are exposed to this race condition?

The issue affects arm64 Linux kernel systems using BPF programs allocated from the BPF program pack. It requires unrelated BPF programs and their PLT entries to share a memory page, which the described allocation model commonly permits.

2

What activity is needed to trigger the problem?

Two CPUs must concurrently attach or detach long-jump trampolines for different target BPF programs whose PLTs share a page. Each operation temporarily changes page permissions while updating its own PLT target, without serialization against the other update.

3

What is the observed effect of a successful race?

One CPU can make the shared page read-only after another CPU has made it writable but before that CPU writes its PLT target. The later write can then fault as a kernel write to read-only memory; the report notes this was observed while attaching fentry programs to BPF programs on an arm64 server with 64K pages.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203