CVE-2025-37940 ftrace: Add cond_resched() to ftrace_graph_set_hash()

Medium 5.5 Published Updated

A missing scheduling call in the Linux kernel ftrace subsystem can cause softlockups and system unresponsiveness when tracing many functions.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-37940?

CVE-2025-37940 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 20 May 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

ftrace: Add cond_resched() to ftrace_graph_set_hash()

When the kernel contains a large number of functions that can be traced, the loop in ftrace_graph_set_hash() may take a lot of time to execute. This may trigger the softlockup watchdog.

Add cond_resched() within the loop to allow the kernel to remain responsive even when processing a large number of functions.

This matches the cond_resched() that is used in other locations of the code that iterates over all functions that can be traced.

Weakness: CWE-667

Which versions are affected by CVE-2025-37940?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-37940?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-37940 being exploited?

There is no known exploitation of CVE-2025-37940 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BELL-CVE-2025-37940, DEBIAN-CVE-2025-37940, GHSA-69hw-3r8x-9jf6, ROOT-OS-DEBIAN-11-CVE-2025-37940, ROOT-OS-UBUNTU-2204-CVE-2025-37940, ROOT-OS-UBUNTU-2404-CVE-2025-37940 and 1 more.

Is CVE-2025-37940 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free