CVE-2025-38522 sched/ext: Prevent update_locked_rq() calls with NULL rq

Medium 5.5 Published Updated

A null pointer dereference in the Linux kernel scheduler can cause a system crash when update_locked_rq is called with a NULL runqueue.

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-38522?

CVE-2025-38522 is a medium-severity vulnerability in Linux kernel, published on 16 Aug 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:

sched/ext: Prevent update_locked_rq() calls with NULL rq

Avoid invoking update_locked_rq() when the runqueue (rq) pointer is NULL in the SCX_CALL_OP and SCX_CALL_OP_RET macros.

Previously, calling update_locked_rq(NULL) with preemption enabled could trigger the following warning:

BUG: using __this_cpu_write() in preemptible [00000000]

This happens because __this_cpu_write() is unsafe to use in preemptible context.

rq is NULL when an ops invoked from an unlocked context. In such cases, we don't need to store any rq, since the value should already be NULL (unlocked). Ensure that update_locked_rq() is only called when rq is non-NULL, preventing calling __this_cpu_write() on preemptible context.

Weakness: CWE-476

Which versions are affected by CVE-2025-38522?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-38522?

Apply the vendor's patch.

Is CVE-2025-38522 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2025-38522, GHSA-8mqg-35g3-7pvm, UBUNTU-CVE-2025-38522.

Is CVE-2025-38522 in your software?

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

Check your SBOMs for free