# CVE-2024-50140: sched/core: Disable page allocation in task\_tick\_mm\_cid()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **Published:** 2024-11-07T09:31:17.379Z
- **Modified:** 2026-06-17T08:03:41.480Z

## Who should check

- Anyone running Linux \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 509c29d0d26f68a6f6d0a05cb1a89725237e2b87; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< ce0241ef83eed55f675376e8a3605d23de53d875; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 73ab05aa46b02d96509cb029a8d04fca7bbde8c7
- Anyone running Linux 6.4

## Description

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

sched/core: Disable page allocation in task\_tick\_mm\_cid()

With KASAN and PREEMPT\_RT enabled, calling task\_work\_add() in
task\_tick\_mm\_cid() may cause the following splat.

\[   63.696416\] BUG: sleeping function called from invalid context at kernel/locking/spinlock\_rt.c:48
\[   63.696416\] in\_atomic(): 1, irqs\_disabled(): 1, non\_block: 0, pid: 610, name: modprobe
\[   63.696416\] preempt\_count: 10001, expected: 0
\[   63.696416\] RCU nest depth: 1, expected: 1

This problem is caused by the following call trace.

  sched\_tick() \[ acquire rq-\>\_\_lock \]
   -\> task\_tick\_mm\_cid()
    -\> task\_work\_add()
     -\> \_\_kasan\_record\_aux\_stack()
      -\> kasan\_save\_stack()
       -\> stack\_depot\_save\_flags()
        -\> alloc\_pages\_mpol\_noprof()
         -\> \_\_alloc\_pages\_noprof()
	  -\> get\_page\_from\_freelist()
	   -\> rmqueue()
	    -\> rmqueue\_pcplist()
	     -\> \_\_rmqueue\_pcplist()
	      -\> rmqueue\_bulk()
	       -\> rt\_spin\_lock()

The rq lock is a raw\_spinlock\_t. We can't sleep while holding
it. IOW, we can't call alloc\_pages() in stack\_depot\_save\_flags().

The task\_tick\_mm\_cid() function with its task\_work\_add() call was
introduced by commit 223baf9d17f2 ("sched: Fix performance regression
introduced by mm\_cid") in v6.4 kernel.

Fortunately, there is a kasan\_record\_aux\_stack\_noalloc() variant that
calls stack\_depot\_save\_flags() while not allowing it to allocate
new pages.  To allow task\_tick\_mm\_cid() to use task\_work without
page allocation, a new TWAF\_NO\_ALLOC flag is added to enable calling
kasan\_record\_aux\_stack\_noalloc() instead of kasan\_record\_aux\_stack()
if set. The task\_tick\_mm\_cid() function is modified to add this new flag.

The possible downside is the missing stack trace in a KASAN report due
to new page allocation required when task\_work\_add\_noallloc() is called
which should be rare.

## Affected and fixed versions

- Linux: \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 509c29d0d26f68a6f6d0a05cb1a89725237e2b87; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< ce0241ef83eed55f675376e8a3605d23de53d875; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 73ab05aa46b02d96509cb029a8d04fca7bbde8c7 (cvelist)
- Linux: 6.4 (cvelist)

## Mitigation

- Upgrade Linux to 73ab05aa46b02d96509cb029a8d04fca7bbde8c7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-50140. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-50140.md
Affected: Linux >= 223baf9d17f25e2608dbdff7232c095c1e612268, < 509c29d0d26f68a6f6d0a05cb1a89725237e2b87; >= 223baf9d17f25e2608dbdff7232c095c1e612268, < ce0241ef83eed55f675376e8a3605d23de53d875; >= 223baf9d17f25e2608dbdff7232c095c1e612268, < 73ab05aa46b02d96509cb029a8d04fca7bbde8c7; Linux 6.4
Fixed in: Linux 509c29d0d26f68a6f6d0a05cb1a89725237e2b87, Linux 73ab05aa46b02d96509cb029a8d04fca7bbde8c7

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-50140 being exploited?

There is no confirmed exploitation: CVE-2024-50140 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-50140?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-50140?

Linux \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 509c29d0d26f68a6f6d0a05cb1a89725237e2b87; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< ce0241ef83eed55f675376e8a3605d23de53d875; \>= 223baf9d17f25e2608dbdff7232c095c1e612268, \< 73ab05aa46b02d96509cb029a8d04fca7bbde8c7; Linux 6.4.

### Is there a fix for CVE-2024-50140?

Yes. Fixed in Linux 509c29d0d26f68a6f6d0a05cb1a89725237e2b87, Linux 73ab05aa46b02d96509cb029a8d04fca7bbde8c7. Upgrade Linux to 73ab05aa46b02d96509cb029a8d04fca7bbde8c7 or later.

### How do I check if I'm affected by CVE-2024-50140?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/509c29d0d26f68a6f6d0a05cb1a89725237e2b87>
- patch: <https://git.kernel.org/stable/c/ce0241ef83eed55f675376e8a3605d23de53d875>
- patch: <https://git.kernel.org/stable/c/73ab05aa46b02d96509cb029a8d04fca7bbde8c7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-50140>

HTML: <https://flawdb.com/CVE-2024-50140> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-50140>
