# CVE-2021-47462: mm/mempolicy: do not allow illegal MPOL\_F\_NUMA\_BALANCING \| MPOL\_LOCAL in mbind()

> 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, NVD) `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.27% (percentile 12, 2026-11-26)
- **CWE:** CWE-908
- **Published:** 2024-05-22T06:23:23.034Z
- **Modified:** 2026-06-17T04:17:31.863Z

## Who should check

- Anyone running Linux \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9; \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c
- Anyone running Linux 5.12

## Description

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

mm/mempolicy: do not allow illegal MPOL\_F\_NUMA\_BALANCING \| MPOL\_LOCAL in mbind()

syzbot reported access to unitialized memory in mbind() \[1\]

Issue came with commit bda420b98505 ("numa balancing: migrate on fault
among multiple bound nodes")

This commit added a new bit in MPOL\_MODE\_FLAGS, but only checked valid
combination (MPOL\_F\_NUMA\_BALANCING can only be used with MPOL\_BIND) in
do\_set\_mempolicy()

This patch moves the check in sanitize\_mpol\_flags() so that it is also
used by mbind()

  \[1\]
  BUG: KMSAN: uninit-value in \_\_mpol\_equal+0x567/0x590 mm/mempolicy.c:2260
   \_\_mpol\_equal+0x567/0x590 mm/mempolicy.c:2260
   mpol\_equal include/linux/mempolicy.h:105 \[inline\]
   vma\_merge+0x4a1/0x1e60 mm/mmap.c:1190
   mbind\_range+0xcc8/0x1e80 mm/mempolicy.c:811
   do\_mbind+0xf42/0x15f0 mm/mempolicy.c:1333
   kernel\_mbind mm/mempolicy.c:1483 \[inline\]
   \_\_do\_sys\_mbind mm/mempolicy.c:1490 \[inline\]
   \_\_se\_sys\_mbind+0x437/0xb80 mm/mempolicy.c:1486
   \_\_x64\_sys\_mbind+0x19d/0x200 mm/mempolicy.c:1486
   do\_syscall\_x64 arch/x86/entry/common.c:51 \[inline\]
   do\_syscall\_64+0x54/0xd0 arch/x86/entry/common.c:82
   entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae

  Uninit was created at:
   slab\_alloc\_node mm/slub.c:3221 \[inline\]
   slab\_alloc mm/slub.c:3230 \[inline\]
   kmem\_cache\_alloc+0x751/0xff0 mm/slub.c:3235
   mpol\_new mm/mempolicy.c:293 \[inline\]
   do\_mbind+0x912/0x15f0 mm/mempolicy.c:1289
   kernel\_mbind mm/mempolicy.c:1483 \[inline\]
   \_\_do\_sys\_mbind mm/mempolicy.c:1490 \[inline\]
   \_\_se\_sys\_mbind+0x437/0xb80 mm/mempolicy.c:1486
   \_\_x64\_sys\_mbind+0x19d/0x200 mm/mempolicy.c:1486
   do\_syscall\_x64 arch/x86/entry/common.c:51 \[inline\]
   do\_syscall\_64+0x54/0xd0 arch/x86/entry/common.c:82
   entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
  =====================================================
  Kernel panic - not syncing: panic\_on\_kmsan set ...
  CPU: 0 PID: 15049 Comm: syz-executor.0 Tainted: G    B             5.15.0-rc2-syzkaller \#0
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
  Call Trace:
   \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
   dump\_stack\_lvl+0x1ff/0x28e lib/dump\_stack.c:106
   dump\_stack+0x25/0x28 lib/dump\_stack.c:113
   panic+0x44f/0xdeb kernel/panic.c:232
   kmsan\_report+0x2ee/0x300 mm/kmsan/report.c:186
   \_\_msan\_warning+0xd7/0x150 mm/kmsan/instrumentation.c:208
   \_\_mpol\_equal+0x567/0x590 mm/mempolicy.c:2260
   mpol\_equal include/linux/mempolicy.h:105 \[inline\]
   vma\_merge+0x4a1/0x1e60 mm/mmap.c:1190
   mbind\_range+0xcc8/0x1e80 mm/mempolicy.c:811
   do\_mbind+0xf42/0x15f0 mm/mempolicy.c:1333
   kernel\_mbind mm/mempolicy.c:1483 \[inline\]
   \_\_do\_sys\_mbind mm/mempolicy.c:1490 \[inline\]
   \_\_se\_sys\_mbind+0x437/0xb80 mm/mempolicy.c:1486
   \_\_x64\_sys\_mbind+0x19d/0x200 mm/mempolicy.c:1486
   do\_syscall\_x64 arch/x86/entry/common.c:51 \[inline\]
   do\_syscall\_64+0x54/0xd0 arch/x86/entry/common.c:82
   entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae

## Affected and fixed versions

- Linux: \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9; \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47462.md
Affected: Linux >= bda420b985054a3badafef23807c4b4fa38a3dff, < 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9; >= bda420b985054a3badafef23807c4b4fa38a3dff, < 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c; Linux 5.12
Fixed in: Linux 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9, Linux 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c

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-2021-47462 being exploited?

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

### How serious is CVE-2021-47462?

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

### Which versions are affected by CVE-2021-47462?

Linux \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9; \>= bda420b985054a3badafef23807c4b4fa38a3dff, \< 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c; Linux 5.12.

### Is there a fix for CVE-2021-47462?

Yes. Fixed in Linux 9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9, Linux 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c. Upgrade Linux to 6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c or later.

### How do I check if I'm affected by CVE-2021-47462?

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/9ee4e9ae98f1f262d6fae0d266cfdf3ba2c321d9>
- patch: <https://git.kernel.org/stable/c/6d2aec9e123bb9c49cb5c7fc654f25f81e688e8c>

## 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-2021-47462>

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