Cloudanix VulnDB

CVE-2024-56786

Medium · 5.5

CVSS

5.5

EPSS

—

Published

Jan 8, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in how the Linux kernel cleans up certain network programs could let attackers crash machines or take over the system, so organizations should update their Linux software right away.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Privilege Gain
Component
OS kernel
Class
Use After Free
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Deferred deallocation of BPF links combined with mismatched RCU grace period semantics between BPF programs and attach hooks could allow a use-after-free when bpf_prog_put is called too early, freeing a program while an attach hook still holds a reference.

Why it matters to the business

Unpatched systems risk kernel crashes, memory corruption, or local privilege escalation that can disrupt services, enable ransomware deployment, or allow attackers to persist in Linux environments; the high number of downstream dependents increases exposure across the ecosystem.

How an attack unfolds

An attacker loads a malicious BPF program attached via a link that uses sleepable hooks, triggers conditions where RCU Tasks Trace and classic RCU GPs race, then uses the freed program pointer to corrupt kernel memory or execute arbitrary code; related threat actor activity around CVE-2025-21702 demonstrates active interest in similar Linux kernel privilege-escalation paths.

How to fix it

Upgrade the Linux kernel to version 6.12.5-1 or later on all Debian 13 systems; apply the fix that moves bpf_prog_put into the bpf_link_dealloc helper and ensure all BPF link types respect the combined RCU Tasks Trace plus classic RCU grace periods before deallocation.

How to confirm the fix worked

Confirm the running kernel reports version 6.12.5-1 or newer, verify the bpf_link_dealloc helper is present in the kernel source or binary, and test that BPF link teardown no longer frees programs before the required grace periods complete.

Typical attack path

  1. Obtain local code execution on a vulnerable Linux host
  2. Load a BPF program attached through a link that exercises deferred deallocation
  3. Trigger RCU grace period timing differences between program and link release
  4. Reuse the dangling program pointer for memory corruption or code execution
  5. Escalate privileges or install persistence

How to detect it

Search kernel logs and audit trails for unexpected BPF program release errors, RCU stall warnings, or use-after-free reports around bpf_link and bpf_prog_put; inspect system call traces involving BPF link detachment for anomalous timing or crashes that predate the 6.12.5-1 kernel.

What your security team should do

  • Immediately schedule kernel upgrades to 6.12.5-1 across all Debian 13 fleets
  • Prioritize systems running BPF programs or containers that attach links
  • Monitor for post-upgrade stability of sleepable BPF hooks
  • Review and restrict untrusted BPF loading until patches are applied

The record

In the Linux kernel, the following vulnerability has been resolved: bpf: put bpf_link's program when link is safe to be deallocated In general, BPF link's underlying BPF program should be considered to be reachable through attach hook -> link -> prog chain, and, pessimistically, we have to assume that as long as link's memory is not safe to free, attach hook's code might hold a pointer to BPF program and use it. As such, it's not (generally) correct to put link's program early before waiting for RCU GPs to go through. More eager bpf_prog_put() that we currently do is mostly correct due to BPF program's release code doing similar RCU GP waiting, but as will be shown in the following patches, BPF program can be non-sleepable (and, thus, reliant on only "classic" RCU GP), while BPF link's attach hook can have sleepable semantics and needs to be protected by RCU Tasks Trace, and for such cases BPF link has to go through RCU Tasks Trace + "classic" RCU GPs before being deallocated. And so, if we put BPF program early, we might free BPF program before we free BPF link, leading to use-after-free situation. So, this patch defers bpf_prog_put() until we are ready to perform bpf_link's deallocation. At worst, this delays BPF program freeing by one extra RCU GP, but that seems completely acceptable. Alternatively, we'd need more elaborate ways to determine BPF hook, BPF link, and BPF program lifetimes, and how they relate to each other, which seems like an unnecessary complication. Note, for most BPF links we still will perform eager bpf_prog_put() and link dealloc, so for those BPF links there are no observable changes whatsoever. Only BPF links that use deferred dealloc might notice slightly delayed freeing of BPF programs. Also, to reduce code and logic duplication, extract program put + link dealloc logic into bpf_link_dealloc() helper.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:9 kernel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-devel-matched 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-debug-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-devel-matched 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-64k-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-abi-stablelists 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-cross-headers 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-devel-matched 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-debug-uki-virt 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-devel-matched 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-doc 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-headers 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-debug-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-64k-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-debug-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-rt-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-tools 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-tools-libs 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-tools-libs-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-uki-virt 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-uki-virt-addons 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-devel 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-devel-matched 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-modules 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-modules-core 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 kernel-zfcpdump-modules-extra 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 libperf 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 perf 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 python3-perf 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 rtla 0 5.14.0-611.5.1.el9_7
AlmaLinux:9 rv 0 5.14.0-611.5.1.el9_7
Debian:11 linux 0 No fix
Debian:12 linux 0 No fix
Debian:13 linux 0 6.12.5-1
Mageia:9 dwarves 0 1.29-1.mga9
Mageia:9 kernel 0 6.6.74-1.mga9
Mageia:9 kernel-linus 0 6.6.74-1.mga9
Mageia:9 kmod-virtualbox 0 7.0.24-64.mga9
Mageia:9 kmod-xtables-addons 0 3.24-70.mga9
Ubuntu:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-aws-5.0 0 No fix
Ubuntu:18.04:LTS linux-aws-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure 0 No fix
Ubuntu:18.04:LTS linux-azure-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure-edge 0 No fix
Ubuntu:18.04:LTS linux-gcp 0 No fix
Ubuntu:18.04:LTS linux-gcp-5.3 0 No fix
Ubuntu:18.04:LTS linux-gke-4.15 0 No fix
Ubuntu:18.04:LTS linux-gke-5.4 0 No fix
Ubuntu:18.04:LTS linux-gkeop-5.4 0 No fix
Ubuntu:18.04:LTS linux-hwe 0 No fix
Ubuntu:18.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-oem 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.0 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.3 0 No fix
Ubuntu:20.04:LTS linux 0 No fix
Ubuntu:20.04:LTS linux-aws 0 No fix
Ubuntu:20.04:LTS linux-aws-5.11 0 No fix
Ubuntu:20.04:LTS linux-aws-5.13 0 No fix
Ubuntu:20.04:LTS linux-aws-5.15 0 No fix
Ubuntu:20.04:LTS linux-aws-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure 0 No fix
Ubuntu:20.04:LTS linux-azure-5.11 0 No fix
Ubuntu:20.04:LTS linux-azure-5.13 0 No fix
Ubuntu:20.04:LTS linux-azure-5.15 0 No fix
Ubuntu:20.04:LTS linux-azure-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure-fde 0 No fix
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 No fix
Ubuntu:20.04:LTS linux-bluefield 0 No fix
Ubuntu:20.04:LTS linux-gcp 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.11 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.13 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.15 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.8 0 No fix
Ubuntu:20.04:LTS linux-gke 0 No fix
Ubuntu:20.04:LTS linux-gke-5.15 0 No fix
Ubuntu:20.04:LTS linux-gkeop 0 No fix
Ubuntu:20.04:LTS linux-gkeop-5.15 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.11 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.13 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.8 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 No fix
Ubuntu:20.04:LTS linux-ibm-5.15 0 No fix
Ubuntu:20.04:LTS linux-intel-5.13 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 No fix
Ubuntu:20.04:LTS linux-iot 0 No fix
Ubuntu:20.04:LTS linux-kvm 0 No fix
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 No fix
Ubuntu:20.04:LTS linux-oem-5.10 0 No fix
Ubuntu:20.04:LTS linux-oem-5.13 0 No fix
Ubuntu:20.04:LTS linux-oem-5.14 0 No fix
Ubuntu:20.04:LTS linux-oem-5.6 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.11 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.13 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.15 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.8 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 No fix
Ubuntu:20.04:LTS linux-raspi2 0 No fix
Ubuntu:20.04:LTS linux-riscv 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.11 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.8 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 No fix
Ubuntu:22.04:LTS linux 0 No fix
Ubuntu:22.04:LTS linux-allwinner-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws 0 No fix
Ubuntu:22.04:LTS linux-aws-5.19 0 No fix
Ubuntu:22.04:LTS linux-aws-6.2 0 No fix
Ubuntu:22.04:LTS linux-aws-6.5 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 No fix
Ubuntu:22.04:LTS linux-aws-6.8 0 6.8.0-1027.29~22.04.1
Ubuntu:22.04:LTS linux-azure 0 No fix
Ubuntu:22.04:LTS linux-azure-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-6.2 0 No fix
Ubuntu:22.04:LTS linux-azure-6.5 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 No fix
Ubuntu:22.04:LTS linux-azure-6.8 0 6.8.0-1027.32~22.04.1
Ubuntu:22.04:LTS linux-azure-fde 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-5.19 0 No fix
Ubuntu:22.04:LTS linux-azure-fde-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp 0 No fix
Ubuntu:22.04:LTS linux-gcp-5.19 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.2 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.5 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 No fix
Ubuntu:22.04:LTS linux-gcp-6.8 0 6.8.0-1028.30~22.04.1
Ubuntu:22.04:LTS linux-gke 0 No fix
Ubuntu:22.04:LTS linux-gkeop 0 No fix
Ubuntu:22.04:LTS linux-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.8 0 No fix
Ubuntu:22.04:LTS linux-hwe-6.8 0 6.8.0-58.60~22.04.1
Ubuntu:22.04:LTS linux-ibm 0 No fix
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 No fix
Ubuntu:22.04:LTS linux-intel-iotg 0 No fix
Ubuntu:22.04:LTS linux-kvm 0 No fix
Ubuntu:22.04:LTS linux-lowlatency 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 No fix
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 6.8.0-58.60.1~22.04.1
Ubuntu:22.04:LTS linux-nvidia 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.2 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.5 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.8 0 No fix
Ubuntu:22.04:LTS linux-nvidia-6.8 0 6.8.0-1026.29~22.04.1
Ubuntu:22.04:LTS linux-oem-5.17 0 No fix
Ubuntu:22.04:LTS linux-oem-6.0 0 No fix
Ubuntu:22.04:LTS linux-oem-6.1 0 No fix
Ubuntu:22.04:LTS linux-oem-6.5 0 No fix
Ubuntu:22.04:LTS linux-oracle 0 No fix
Ubuntu:22.04:LTS linux-oracle-6.5 0 No fix
Ubuntu:22.04:LTS linux-oracle-6.8 0 No fix

Related vulnerabilities