# CVE-2022-49700: mm/slub: add missing TID updates on slab deactivation

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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)
- **CWE:** CWE-416
- **Published:** 2025-02-26T02:24:20.878Z
- **Modified:** 2026-08-05T08:56:04.704Z

## Who should check

- Anyone running Linux \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< d6a597450e686d4c6388bd3cdcb17224b4dae7f0; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e2b2f0e2e34d71ae6c2a1114fd3c525930e84bc7; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e7e3e90d671078455a3a08189f89d85b3da2de9e; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 6c32496964da0dc230cea763a0e934b2e02dabd5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 0515cc9b6b24877f59b222ade704bfaa42caa2a6; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 197e257da473c725dfe47759c3ee02f2398d8ea5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< eeaa345e128515135ccb864c04482180c08e3259
- Anyone running Linux 3.1

## Description

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

mm/slub: add missing TID updates on slab deactivation

The fastpath in slab\_alloc\_node() assumes that c-\>slab is stable as long as
the TID stays the same. However, two places in \_\_slab\_alloc() currently
don't update the TID when deactivating the CPU slab.

If multiple operations race the right way, this could lead to an object
getting lost; or, in an even more unlikely situation, it could even lead to
an object being freed onto the wrong slab's freelist, messing up the
\`inuse\` counter and eventually causing a page to be freed to the page
allocator while it still contains slab objects.

(I haven't actually tested these cases though, this is just based on
looking at the code. Writing testcases for this stuff seems like it'd be
a pain...)

The race leading to state inconsistency is (all operations on the same CPU
and kmem\_cache):

 - task A: begin do\_slab\_free():
    - read TID
    - read pcpu freelist (==NULL)
    - check \`slab == c-\>slab\` (true)
 - \[PREEMPT A-\>B\]
 - task B: begin slab\_alloc\_node():
    - fastpath fails (\`c-\>freelist\` is NULL)
    - enter \_\_slab\_alloc()
    - slub\_get\_cpu\_ptr() (disables preemption)
    - enter \_\_\_slab\_alloc()
    - take local\_lock\_irqsave()
    - read c-\>freelist as NULL
    - get\_freelist() returns NULL
    - write \`c-\>slab = NULL\`
    - drop local\_unlock\_irqrestore()
    - goto new\_slab
    - slub\_percpu\_partial() is NULL
    - get\_partial() returns NULL
    - slub\_put\_cpu\_ptr() (enables preemption)
 - \[PREEMPT B-\>A\]
 - task A: finish do\_slab\_free():
    - this\_cpu\_cmpxchg\_double() succeeds()
    - \[CORRUPT STATE: c-\>slab==NULL, c-\>freelist!=NULL\]

From there, the object on c-\>freelist will get lost if task B is allowed to
continue from here: It will proceed to the retry\_load\_slab label,
set c-\>slab, then jump to load\_freelist, which clobbers c-\>freelist.

But if we instead continue as follows, we get worse corruption:

 - task A: run \_\_slab\_free() on object from other struct slab:
    - CPU\_PARTIAL\_FREE case (slab was on no list, is now on pcpu partial)
 - task A: run slab\_alloc\_node() with NUMA node constraint:
    - fastpath fails (c-\>slab is NULL)
    - call \_\_slab\_alloc()
    - slub\_get\_cpu\_ptr() (disables preemption)
    - enter \_\_\_slab\_alloc()
    - c-\>slab is NULL: goto new\_slab
    - slub\_percpu\_partial() is non-NULL
    - set c-\>slab to slub\_percpu\_partial(c)
    - \[CORRUPT STATE: c-\>slab points to slab-1, c-\>freelist has objects
      from slab-2\]
    - goto redo
    - node\_match() fails
    - goto deactivate\_slab
    - existing c-\>freelist is passed into deactivate\_slab()
    - inuse count of slab-1 is decremented to account for object from
      slab-2

At this point, the inuse count of slab-1 is 1 lower than it should be.
This means that if we free all allocated objects in slab-1 except for one,
SLUB will think that slab-1 is completely unused, and may free its page,
leading to use-after-free.

## Affected and fixed versions

- Linux: \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< d6a597450e686d4c6388bd3cdcb17224b4dae7f0; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e2b2f0e2e34d71ae6c2a1114fd3c525930e84bc7; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e7e3e90d671078455a3a08189f89d85b3da2de9e; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 6c32496964da0dc230cea763a0e934b2e02dabd5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 0515cc9b6b24877f59b222ade704bfaa42caa2a6; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 197e257da473c725dfe47759c3ee02f2398d8ea5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< eeaa345e128515135ccb864c04482180c08e3259 (cvelist)
- Linux: 3.1 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49700.md
Affected: Linux >= 03e404af26dc2ea0d278d7a342de0aab394793ce, < 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082; >= 03e404af26dc2ea0d278d7a342de0aab394793ce, < d6a597450e686d4c6388bd3cdcb17224b4dae7f0; >= 03e404af26dc2ea0d278d7a342de0aab394793ce, < e2b2f0e2e34d71ae6c2a1114fd3c525930e84bc7; >= 03e404af26dc2ea0d278d7a…
Fixed in: Linux 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082, Linux 6c32496964da0dc230cea763a0e934b2e02dabd5, Linux 0515cc9b6b24877f59b222ade704bfaa42caa2a6, Linux 197e257da473c725dfe47759c3ee02f2398d8ea5

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-2022-49700 being exploited?

There is no confirmed exploitation: CVE-2022-49700 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-2022-49700?

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

### Which versions are affected by CVE-2022-49700?

Linux \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< d6a597450e686d4c6388bd3cdcb17224b4dae7f0; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e2b2f0e2e34d71ae6c2a1114fd3c525930e84bc7; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< e7e3e90d671078455a3a08189f89d85b3da2de9e; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 6c32496964da0dc230cea763a0e934b2e02dabd5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 0515cc9b6b24877f59b222ade704bfaa42caa2a6; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< 197e257da473c725dfe47759c3ee02f2398d8ea5; \>= 03e404af26dc2ea0d278d7a342de0aab394793ce, \< eeaa345e128515135ccb864c04482180c08e3259; Linux 3.1.

### Is there a fix for CVE-2022-49700?

Yes. Fixed in Linux 308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082, Linux 6c32496964da0dc230cea763a0e934b2e02dabd5, Linux 0515cc9b6b24877f59b222ade704bfaa42caa2a6, Linux 197e257da473c725dfe47759c3ee02f2398d8ea5. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49700?

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/308c6d0e1f200fd26c71270c6e6bfcf0fc6ff082>
- patch: <https://git.kernel.org/stable/c/d6a597450e686d4c6388bd3cdcb17224b4dae7f0>
- patch: <https://git.kernel.org/stable/c/e2b2f0e2e34d71ae6c2a1114fd3c525930e84bc7>
- patch: <https://git.kernel.org/stable/c/e7e3e90d671078455a3a08189f89d85b3da2de9e>
- patch: <https://git.kernel.org/stable/c/6c32496964da0dc230cea763a0e934b2e02dabd5>
- patch: <https://git.kernel.org/stable/c/0515cc9b6b24877f59b222ade704bfaa42caa2a6>
- patch: <https://git.kernel.org/stable/c/197e257da473c725dfe47759c3ee02f2398d8ea5>
- patch: <https://git.kernel.org/stable/c/eeaa345e128515135ccb864c04482180c08e3259>

## 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-2022-49700>

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