CVE-2026-63825: gcov: use atomic counter updates to fix concurrent access crashes
In the Linux kernel, the following vulnerability has been resolved:
gcov: use atomic counter updates to fix concurrent access crashes
GCC's GCOV instrumentation can merge global branch counters with loop induction variables as an optimization. In inflatefast(), the inner copy loops get transformed so that the GCOV counter value is loaded multiple times to compute the loop base address, start index, and end bound. Since GCOV counters are global (not per-CPU), concurrent execution on different CPUs causes the counter to change between loads, producing inconsistent values and out-of-bounds memory writes.
The crash manifests during IPComp (IP Payload Compression) processing when inflatefast() runs concurrently on multiple CPUs:
BUG: unable to handle page fault for address: ffffd0a3c0902ffa RIP: inflatefast+1431 Call Trace: zlibinflate deflatedecompress cryptocompdecompress ipcompdecompress [xfrmipcomp] ipcompinput [xfrmipcomp] xfrminput
At the crash point, the compiler generated three loads from the same global GCOV counter (gcov0.inflatefast+216) to compute base, start, and end for an indexed loop. Another CPU modified the counter between loads, making the values inconsistent - the write went 3.4 MB past a 65 KB buffer.
Add -fprofile-update=prefer-atomic to CFLAGSGCOV at the global level in the top-level Makefile, guarded by a try-run compile test. The test compiles a minimal program with and without -fprofile-update=prefer-atomic using the full KBUILDCFLAGS, then compares undefined symbols in the resulting object files. If prefer-atomic introduces new undefined references (such as atomicfetchadd8 on i386 or aarch64ldadd8relax on arm64 with outline-atomics), the flag is not added -- the kernel does not link against libatomic.
On architectures where GCC inlines 64-bit atomic counter updates (x8664, s390, ...) the test passes and the flag is enabled, preventing the compiler from merging counters with loop induction variables and fixing the observed concurrent-access crash.
On architectures where the flag would introduce libatomic dependencies, it is silently omitted and behaviour is no worse than before this patch.
Move the CFLAGSGCOV block from its original position (before the arch Makefile include) to after the core KBUILDCFLAGS assignments but before the scripts/Makefile.gcc-plugins include. This placement ensures the try-run test sees arch-specific flags (-m32, -march=, -mno-outline-atomics) while avoiding GCC plugin flags (-fplugin=) that would break the test on clean builds when plugin shared objects do not yet exist.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Adjust the kernel build Makefiles so the CFLAGS_GCOV block is moved from its original position (before the arch Makefile include) to after the core KBUILD_CFLAGS assignments but before the arch KBUILD_CFLAGS include; this ensures the GCOV optimization uses atomic counter updates to prevent concurrent access crashes.
Linux kernel build (KBUILD_CFLAGS / scripts/Makefile.gcc-plugins) CFLAGS_GCOV block placement = Move the CFLAGS_GCOV block to after the core KBUILD_CFLAGS assignments but before include of arch-specific KBUILD_CFLAGS (per patch description) - Configuration
Enable GCOV atomic counter updates by adding -fprofile-update=prefer-atomic to CFLAGS_GCOV at the global level (as described), while avoiding GCC plugin flags (-fplugin=) and omitting the flag on architectures where it would introduce libatomic dependencies (e.g., outline-atomics on arm64).
Linux kernel build (GCOV instrumentation) -fprofile-update=prefer-atomic in CFLAGS_GCOV = enabled conditionally (x86_64, arm64, s390, etc. as described)
Event History
Frequently Asked Questions
What is the severity of CVE-2026-63825?
CVE-2026-63825 has a severity rating of critical with a CVSS score of 9.8.
How do I fix CVE-2026-63825?
To fix CVE-2026-63825, you should update to the latest version of the Linux kernel where the vulnerability has been resolved.
What impact does CVE-2026-63825 have on systems?
CVE-2026-63825 can lead to concurrent access crashes which may affect the stability and reliability of the system.
Is CVE-2026-63825 specific to any version of the Linux kernel?
CVE-2026-63825 affects the Linux kernel versions that utilize GCC's GCOV instrumentation.
What components of GCC are affected by CVE-2026-63825?
CVE-2026-63825 specifically pertains to the gcov component of GCC, which handles global branch counters.