# CVE-2021-47632: powerpc/set\_memory: Avoid spinlock recursion in change\_page\_attr()

> 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.21% (percentile 7, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-02-26T01:54:08.162Z
- **Modified:** 2026-06-17T04:18:11.750Z

## Who should check

- Anyone running Linux \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6def4eaf0391f24be541633a954c0e4876858b1e; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 96917107e67846f1d959ed03be281048efad14c5; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< a4c182ecf33584b9b2d1aa9dad073014a504c01f
- Anyone running Linux 5.14

## Description

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

powerpc/set\_memory: Avoid spinlock recursion in change\_page\_attr()

Commit 1f9ad21c3b38 ("powerpc/mm: Implement set\_memory() routines")
included a spin\_lock() to change\_page\_attr() in order to
safely perform the three step operations. But then
commit 9f7853d7609d ("powerpc/mm: Fix set\_memory\_\*() against
concurrent accesses") modify it to use pte\_update() and do
the operation safely against concurrent access.

In the meantime, Maxime reported some spinlock recursion.

\[   15.351649\] BUG: spinlock recursion on CPU\#0, kworker/0:2/217
\[   15.357540\]  lock: init\_mm+0x3c/0x420, .magic: dead4ead, .owner: kworker/0:2/217, .owner\_cpu: 0
\[   15.366563\] CPU: 0 PID: 217 Comm: kworker/0:2 Not tainted 5.15.0+ \#523
\[   15.373350\] Workqueue: events do\_free\_init
\[   15.377615\] Call Trace:
\[   15.380232\] \[e4105ac0\] \[800946a4\] do\_raw\_spin\_lock+0xf8/0x120 (unreliable)
\[   15.387340\] \[e4105ae0\] \[8001f4ec\] change\_page\_attr+0x40/0x1d4
\[   15.393413\] \[e4105b10\] \[801424e0\] \_\_apply\_to\_page\_range+0x164/0x310
\[   15.400009\] \[e4105b60\] \[80169620\] free\_pcp\_prepare+0x1e4/0x4a0
\[   15.406045\] \[e4105ba0\] \[8016c5a0\] free\_unref\_page+0x40/0x2b8
\[   15.411979\] \[e4105be0\] \[8018724c\] kasan\_depopulate\_vmalloc\_pte+0x6c/0x94
\[   15.418989\] \[e4105c00\] \[801424e0\] \_\_apply\_to\_page\_range+0x164/0x310
\[   15.425451\] \[e4105c50\] \[80187834\] kasan\_release\_vmalloc+0xbc/0x134
\[   15.431898\] \[e4105c70\] \[8015f7a8\] \_\_purge\_vmap\_area\_lazy+0x4e4/0xdd8
\[   15.438560\] \[e4105d30\] \[80160d10\] \_vm\_unmap\_aliases.part.0+0x17c/0x24c
\[   15.445283\] \[e4105d60\] \[801642d0\] \_\_vunmap+0x2f0/0x5c8
\[   15.450684\] \[e4105db0\] \[800e32d0\] do\_free\_init+0x68/0x94
\[   15.456181\] \[e4105dd0\] \[8005d094\] process\_one\_work+0x4bc/0x7b8
\[   15.462283\] \[e4105e90\] \[8005d614\] worker\_thread+0x284/0x6e8
\[   15.468227\] \[e4105f00\] \[8006aaec\] kthread+0x1f0/0x210
\[   15.473489\] \[e4105f40\] \[80017148\] ret\_from\_kernel\_thread+0x14/0x1c

Remove the read / modify / write sequence to make the operation atomic
and remove the spin\_lock() in change\_page\_attr().

To do the operation atomically, we can't use pte modification helpers
anymore. Because all platforms have different combination of bits, it
is not easy to use those bits directly. But all have the
\_PAGE\_KERNEL\_{RO/ROX/RW/RWX} set of flags. All we need it to compare
two sets to know which bits are set or cleared.

For instance, by comparing \_PAGE\_KERNEL\_ROX and \_PAGE\_KERNEL\_RO you
know which bit gets cleared and which bit get set when changing exec
permission.

## Affected and fixed versions

- Linux: \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6def4eaf0391f24be541633a954c0e4876858b1e; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 96917107e67846f1d959ed03be281048efad14c5; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< a4c182ecf33584b9b2d1aa9dad073014a504c01f (cvelist)
- Linux: 5.14 (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-2021-47632. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47632.md
Affected: Linux >= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, < 6def4eaf0391f24be541633a954c0e4876858b1e; >= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, < 96917107e67846f1d959ed03be281048efad14c5; >= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, < 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a; >= 1f9ad21c3b384a8f16d8c46…
Fixed in: Linux 6def4eaf0391f24be541633a954c0e4876858b1e, Linux 96917107e67846f1d959ed03be281048efad14c5, Linux 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a

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-47632 being exploited?

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

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

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

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

Linux \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6def4eaf0391f24be541633a954c0e4876858b1e; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 96917107e67846f1d959ed03be281048efad14c5; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a; \>= 1f9ad21c3b384a8f16d8c46845a48a01d281a603, \< a4c182ecf33584b9b2d1aa9dad073014a504c01f; Linux 5.14.

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

Yes. Fixed in Linux 6def4eaf0391f24be541633a954c0e4876858b1e, Linux 96917107e67846f1d959ed03be281048efad14c5, Linux 6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a. No fix listed yet: follow the vendor advisory.

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

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/6def4eaf0391f24be541633a954c0e4876858b1e>
- patch: <https://git.kernel.org/stable/c/96917107e67846f1d959ed03be281048efad14c5>
- patch: <https://git.kernel.org/stable/c/6ebe5ca2cbe438a688f2ae238ef5a0b0b5f3468a>
- patch: <https://git.kernel.org/stable/c/a4c182ecf33584b9b2d1aa9dad073014a504c01f>

## 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-47632>

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