]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI: CPPC: Fix NULL pointer dereference when nosmp is used
authorYunhui Cui <cuiyunhui@bytedance.com>
Wed, 4 Jun 2025 02:30:36 +0000 (10:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 13:32:29 +0000 (15:32 +0200)
commit32a48db4cf28ea087214c261da8476db218d08bd
tree5c9864dc8f9d26b029b4d60ae1d316953aca6867
parentc3892f1ba0bcea23b52f477d5b9ce44c1d7f5cbe
ACPI: CPPC: Fix NULL pointer dereference when nosmp is used

[ Upstream commit 15eece6c5b05e5f9db0711978c3e3b7f1a2cfe12 ]

With nosmp in cmdline, other CPUs are not brought up, leaving
their cpc_desc_ptr NULL. CPU0's iteration via for_each_possible_cpu()
dereferences these NULL pointers, causing panic.

Panic backtrace:

[    0.401123] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000b8
...
[    0.403255] [<ffffffff809a5818>] cppc_allow_fast_switch+0x6a/0xd4
...
Kernel panic - not syncing: Attempted to kill init!

Fixes: 3cc30dd00a58 ("cpufreq: CPPC: Enable fast_switch")
Reported-by: Xu Lu <luxu.kernel@bytedance.com>
Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
Link: https://patch.msgid.link/20250604023036.99553-1-cuiyunhui@bytedance.com
[ rjw: New subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/cppc_acpi.c