CVE-2021-47350

powerpc/mm: Fix lockup on kernel exec fault

MEDIUM
5.5
CVSS Score
Published: May 21, 2024 at 02:35 PM UTC
Updated: June 17, 2026 at 04:17 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: powerpc/mm: Fix lockup on kernel exec fault The powerpc kernel is not prepared to handle exec faults from kernel. Especially, the function is_exec_fault() will return 'false' when an exec fault is taken by kernel, because the check is based on reading current->thread.regs->trap which contains the trap from user. For instance, when provoking a LKDTM EXEC_USERSPACE test, current->thread.regs->trap is set to SYSCALL trap (0xc00), and the fault taken by the kernel is not seen as an exec fault by set_access_flags_filter(). Commit d7df2443cd5f ("powerpc/mm: Fix spurious segfaults on radix with autonuma") made it clear and handled it properly. But later on commit d3ca587404b3 ("powerpc/mm: Fix reporting of kernel execute faults") removed that handling, introducing test based on error_code. And here is the problem, because on the 603 all upper bits of SRR1 get cleared when the TLB instruction miss handler bails out to ISI. Until commit cbd7e6ca0210 ("powerpc/fault: Avoid heavy search_exception_tables() verification"), an exec fault from kernel at a userspace address was indirectly caught by the lack of entry for that address in the exception tables. But after that commit the kernel mainly relies on KUAP or on core mm handling to catch wrong user accesses. Here the access is not wrong, so mm handles it. It is a minor fault because PAGE_EXEC is not set, set_access_flags_filter() should set PAGE_EXEC and voila. But as is_exec_fault() returns false as explained in the beginning, set_access_flags_filter() bails out without setting PAGE_EXEC flag, which leads to a forever minor exec fault. As the kernel is not prepared to handle such exec faults, the thing to do is to fire in bad_kernel_fault() for any exec fault taken by the kernel, as it was prior to commit d3ca587404b3.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.14 ≤ v < 5.10.514.14 ≤ v < 5.12.184.14 ≤ v < 5.13.34.14 ≤ v < 5.144.14 ≤ v < 5.4.1335.11 ≤ v < 5.12.185.13 ≤ v < 5.13.35.5 ≤ v < 5.10.514.14d3ca587404b36943b02df87406054ce73cc49500
Vendor states this is fixed in 500f81cec9f1bfa5210aa9dd5ba9a06e22f62a35 (fixed)
Vendor states this is fixed in 8a96ec5ebf96ad8e2ba7b1b34103a0be5140fc70 (fixed)
Vendor states this is fixed in a82471a14aad90f79d1608d2bcbb019f0ffb53f0 (fixed)
Vendor states this is fixed in cd5d5e602f502895e47e18cd46804d6d7014e65c (fixed)
Vendor states this is fixed in d2e52d4664097a6c1f591d869ec594bd7a0d4925 (fixed)
Vendor states this is fixed in 4.14 (unaffected)
Vendor states this is fixed in 5.10.51 (unaffected)
Vendor states this is fixed in 5.12.18 (unaffected)
Vendor states this is fixed in 5.13.3 (unaffected)
Vendor states this is fixed in 5.14 (unaffected)
Vendor states this is fixed in 5.4.133 (unaffected)

References (5)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/500f81cec9f1bfa5210aa9dd5ba9a06e22f62a35
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/8a96ec5ebf96ad8e2ba7b1b34103a0be5140fc70
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a82471a14aad90f79d1608d2bcbb019f0ffb53f0
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/cd5d5e602f502895e47e18cd46804d6d7014e65c
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d2e52d4664097a6c1f591d869ec594bd7a0d4925

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.5MEDIUMCISA-ADP
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-667

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card