CVE-2021-47454
kernel: powerpc/smp: do not decrement idle task preempt count in CPU offline
Overview
Description
In the Linux kernel, the following vulnerability has been resolved:
powerpc/smp: do not decrement idle task preempt count in CPU offline
With PREEMPT_COUNT=y, when a CPU is offlined and then onlined again, we
get:
BUG: scheduling while atomic: swapper/1/0/0x00000000
no locks held by swapper/1/0.
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.15.0-rc2+ #100
Call Trace:
dump_stack_lvl+0xac/0x108
__schedule_bug+0xac/0xe0
__schedule+0xcf8/0x10d0
schedule_idle+0x3c/0x70
do_idle+0x2d8/0x4a0
cpu_startup_entry+0x38/0x40
start_secondary+0x2ec/0x3a0
start_secondary_prolog+0x10/0x14
This is because powerpc's arch_cpu_idle_dead() decrements the idle task's
preempt count, for reasons explained in commit a7c2bb8279d2 ("powerpc:
Re-enable preemption before cpu_die()"), specifically "start_secondary()
expects a preempt_count() of 0."
However, since commit 2c669ef6979c ("powerpc/preempt: Don't touch the idle
task's preempt_count during hotplug") and commit f1a0a376ca0c ("sched/core:
Initialize the idle task with preemption disabled"), that justification no
longer holds.
The idle task isn't supposed to re-enable preemption, so remove the
vestigial preempt_enable() from the CPU offline path.
Tested with pseries and powernv in qemu, and pseries on PowerVM.
Source: OX vulnerability database
Severity
5.5 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 39 fixes
Oracle Linux 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 9 | kernel +28 | 5.14.0-503.11.1.el9_5 |
| 9 | bpftool | 7.4.0-503.11.1.el9_5 |
Photon OS 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | bpftool +9 | 5.10.46-2.ph4 |
Red Hat 2 releases · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 7 | bpftool +25 | eol | — |
| 9 | kernel-rt +20 | affected | — |
| 9 | kernel +61 | 0:5.14.0-503.11.1.el9_5 | RHSA-2024:9315 |
| 9 | bpftool | 0:7.4.0-503.11.1.el9_5 | RHSA-2024:9315 |
SUSE Linux Enterprise 2 releases · 7 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | kernel-livepatch-5-14-21-150400-24-122-default | 1-150400.9.3.2 | SUSE-SU-2024:2189-1 |
| 15.4 | kernel-devel +3 | 5.14.21-150400.24.122.1 | SUSE-SU-2024:2189-1 |
| 15.4 | cluster-md-kmp-default +13 | 5.14.21-150400.24.122.2 | SUSE-SU-2024:2189-1 |
| 15.4 | kernel-default-base | 5.14.21-150400.24.122.2.150400.24.58.2 | SUSE-SU-2024:2189-1 |
| 15.5 | kernel-livepatch-5-14-21-150500-13-58-rt | 1-150500.11.3.1 | SUSE-SU-2024:2008-1 |
| 15.5 | kernel-livepatch-5-14-21-150500-55-68-default | 1-150500.11.3.1 | SUSE-SU-2024:2190-1 |
3 more rows
SUSE Linux Enterprise Micro 3 releases · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.3 | kernel-rt +1 | 5.14.21-150400.15.82.1 | SUSE-SU-2024:2011-1 |
| 5.3 | kernel-default | 5.14.21-150400.24.122.2 | SUSE-SU-2024:2189-1 |
| 5.3 | kernel-default-base | 5.14.21-150400.24.122.2.150400.24.58.2 | SUSE-SU-2024:2189-1 |
| 5.4 | kernel-rt +1 | 5.14.21-150400.15.82.1 | SUSE-SU-2024:2011-1 |
| 5.4 | kernel-default | 5.14.21-150400.24.122.2 | SUSE-SU-2024:2189-1 |
| 5.4 | kernel-default-base | 5.14.21-150400.24.122.2.150400.24.58.2 | SUSE-SU-2024:2189-1 |
3 more rows
debian 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux | 5.10.84-1 |
| 12 | linux | 5.14.16-1 |
| 13 | linux | 5.14.16-1 |
| 14 | linux | 5.14.16-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 5.14.16-1 |
openSUSE Leap Micro 2 releases · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.3 | kernel-rt | 5.14.21-150400.15.82.1 | SUSE-SU-2024:2011-1 |
| 5.3 | kernel-default | 5.14.21-150400.24.122.2 | SUSE-SU-2024:2189-1 |
| 5.3 | kernel-default-base | 5.14.21-150400.24.122.2.150400.24.58.2 | SUSE-SU-2024:2189-1 |
| 5.4 | kernel-rt | 5.14.21-150400.15.82.1 | SUSE-SU-2024:2011-1 |
| 5.4 | kernel-default | 5.14.21-150400.24.122.2 | SUSE-SU-2024:2189-1 |
| 5.4 | kernel-default-base | 5.14.21-150400.24.122.2.150400.24.58.2 | SUSE-SU-2024:2189-1 |
root.io debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | rootio-linux | 5.10.84-1 |
| 12 | rootio-linux | 5.14.16-1 |
| 13 | rootio-linux | 5.14.16-1 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2021-47454
- git.kernel.org https://git.kernel.org/stable/c/3ea0b497a7a2fff6a4b7090310c9f52c91975934
- git.kernel.org https://git.kernel.org/stable/c/53770a411559cf7bc0906d1df319cc533d2f4f58
- git.kernel.org https://git.kernel.org/stable/c/787252a10d9422f3058df9a4821f389e5326c440
- linux.oracle.com https://linux.oracle.com/cve/CVE-2021-47454.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2024-9315.html
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2024052243-CVE-2021-47454-e852@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2021-47454
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2021-47454
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.