CVE-2026-31413: bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR

Published Apr 12, 2026
·
Updated

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

bpf: Fix unsound scalar forking in maybeforkscalars() for BPFOR

maybeforkscalars() is called for both BPFAND and BPFOR when the source operand is a constant. When dst has signed range [-1, 0], it forks the verifier state: the pushed path gets dst = 0, the current path gets dst = -1.

For BPFAND this is correct: 0 & K == 0. For BPFOR this is wrong: 0 | K == K, not 0.

The pushed path therefore tracks dst as 0 when the runtime value is K, producing an exploitable verifier/runtime divergence that allows out-of-bounds map access.

Fix this by passing env->insnidx (instead of env->insnidx + 1) to pushstack(), so the pushed path re-executes the ALU instruction with dst = 0 and naturally computes the correct result for any opcode.

Affected Software

4 affected components
Linux Linux kernel (BPF)
Linux Linux kernel>=6.12.75<6.12.80
Linux Linux kernel>=6.18.16<6.18.21
Linux Linux kernel>=6.19.6<6.19.11

Event History

Apr 12, 2026
CVE Published
via MITRE·05:36 AM
Data Sourced
via MITRE·05:36 AM
DescriptionSeverity
Data Sourced
via NVD·06:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Exploit Published
via GitHub·10:41 AM

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