In the Linux kernel, the following vulnerability has been resolved:
x86/ftrace: Relocate %rip-relative percpu refs in dynamic trampolines
With CONFIG_CALL_DEPTH_TRACKING enabled on an x86 retbleed-affected platform (eg: Skylake), with retbleed=stuff, registering a dynamic ftrace trampoline crashes on the first call into the traced function:
BUG: unable to handle page fault for address: ffff88817ae18880 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 4b53067 P4D 4b53067 PUD 0 Oops: Oops: 0002 [#1] SMP PTI CPU: 3 UID: 0 PID: 187 Comm: usleep Not tainted 7.0.10 #243 PREEMPT(full) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.17.0-2-2 04/01/2014 Code: 24 78 00 00 00 00 48 89 ea 48 89 54 24 20 48 8b b4 24 b8 00 00 00 48 8b bc 24 b0 00 00 00 48 89 bc 24 80 00 00 00 48 83 ef 05 <65> 48 c1 3d 1f a8 b6 02 05 48 8b 15 f6 00 00 00 4c 89 3c 24 4c 89 Call Trace: <TASK> ? find_held_lock ? exc_page_fault ? lock_release ? __x64_sys_clock_nanosleep ? lockdep_hardirqs_on_prepare ? trace_hardirqs_on __x64_sys_clock_nanosleep do_syscall_64 ? exc_page_fault ? call_depth_return_thunk entry_SYSCALL_64_after_hwframe ... Kernel panic - not syncing: Fatal exception
This small reproducer allows to easily trigger the crash:
# echo 'p __x64_sys_clock_nanosleep' > /sys/kernel/tracing/kprobe_events # echo 1 > /sys/kernel/tracing/events/kprobes/p___x64_sys_clock_nanosleep_0/enable # usleep 1
Monitoring the crash under GDB points to the exact instruction in charge of incrementing the call depth:
sarq $5, %gs:__x86_call_depth(%rip)
This instruction matches the one inserted by the ftrace_regs_caller from ftrace_64.S. This emitted code was likely working fine until the introduction of
59bec00ace28 ("x86/percpu: Introduce %rip-relative addressing to PER_CPU_VAR()"):
it has made the call depth accounting addressing relative to $rip, instead of being based on an absolute address.
As this code exact location depends on where the trampoline lives in memory, the corresponding displacement needs to be adjusted at runtime to actually correctly find the per-cpu __x86_call_depth value, otherwise the targeted address is wrong, leading to the page fault seen above.
Fix the %rip-relative displacement of the copied CALL_DEPTH_ACCOUNT instruction (from ftrace_regs_caller) by calling text_poke_apply_relocation(), as it is done for example by the x86 BPF JIT compiler through x86_call_depth_emit_accounting(). This corrects both CALL_DEPTH_ACCOUNT slots, in ftrace_caller and ftrace_regs_caller.
[ bp: Massage. ]
CVSS Details
- CVSS 3.1 Base Score: 8.1
- CVSS 3.1 Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon_linux_2023 | — | Upgrade kernel6.12-tools-debuginfoUpgrade kernel6.12-toolsUpgrade kernel6.12-develUpgrade kernel6.18-tools-develUpgrade kernel6.18-modules-extra-commonUpgrade kernel6.18-toolsUpgrade kernel6.12-headersUpgrade python3-perf6.12Upgrade perf6.12-debuginfoUpgrade kernel6.12-debuginfo-common-x86_64Upgrade kernel6.18-modules-extraUpgrade kernel6.12-tools-develUpgrade bpftool6.18Upgrade kernel6.18Upgrade kernel6.18-develUpgrade perf6.18Upgrade python3-perf6.12-debuginfoUpgrade kernel6.12-debuginfo-common-aarch64Upgrade python3-perf6.18-debuginfoUpgrade kernel6.18-headersUpgrade kernel-livepatch-6.12.94-123.174Upgrade kernel6.12-modules-extraUpgrade bpftool6.12-debuginfoUpgrade kernel6.18-debuginfo-common-aarch64Upgrade kernel6.18-tools-debuginfoUpgrade kernel6.18-debuginfo-common-x86_64Upgrade perf6.12Upgrade kernel6.12Upgrade python3-perf6.18Upgrade kernel6.12-debuginfoUpgrade kernel6.18-debuginfoUpgrade kernel6.12-modules-extra-commonUpgrade bpftool6.12Upgrade microvm-kernel6.18Upgrade kernel-livepatch-6.18.35-68.127Upgrade perf6.18-debuginfoUpgrade bpftool6.18-debuginfo | Aug 18, 2026 | Jul 24, 2026 |
| Debian | — | Upgrade linux | Jul 28, 2026 | Jul 28, 2026 |
| Redhat_linux | — | No solution exists | Jul 29, 2026 | Jul 24, 2026 |
| Ubuntu | — | Upgrade linux-image-raspi-7.0Upgrade linux-image-7.0.0-1015-raspiUpgrade linux-image-7.0.0-1015-raspi-realtimeUpgrade linux-image-raspiUpgrade linux-image-7.0.0-1011-gcp-64kUpgrade linux-image-raspi-realtime-7.0Upgrade linux-image-nvidia-7.0Upgrade linux-image-aws-7.0Upgrade linux-image-nvidia-64k-7.0Upgrade linux-image-awsUpgrade linux-image-nvidia-bosUpgrade linux-image-nvidia-bos-64k-7.0Upgrade linux-image-gcp-64kUpgrade linux-image-7.0.0-1016-nvidiaUpgrade linux-image-7.0.0-2016-nvidia-bos-64kUpgrade linux-image-7.0.0-2016-nvidia-bosUpgrade linux-image-gcp-64k-7.0Upgrade linux-image-aws-64k-7.0Upgrade linux-image-7.0.0-1009-aws-64kUpgrade linux-image-nvidia-64kUpgrade linux-image-nvidia-bos-7.0Upgrade linux-image-gcpUpgrade linux-image-raspi-realtimeUpgrade linux-image-gcp-7.0Upgrade linux-image-7.0.0-1011-gcpUpgrade linux-image-nvidia-64k-hwe-26.04Upgrade linux-image-7.0.0-1016-nvidia-64kUpgrade linux-image-nvidia-hwe-26.04Upgrade linux-image-nvidiaUpgrade linux-image-aws-64kUpgrade linux-image-7.0.0-1009-awsUpgrade linux-image-nvidia-bos-64k | Jul 28, 2026 | Jul 28, 2026 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Aug 3, 2026 | Jul 24, 2026 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub