mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] cpuidle: Fix crash with single idle state
@ 2026-02-16 18:50 Aboorva Devarajan
  2026-02-16 18:50 ` [PATCH v2 1/4] cpuidle: Skip governor when only one idle state is available Aboorva Devarajan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Aboorva Devarajan @ 2026-02-16 18:50 UTC (permalink / raw)
  To: rafael, christian.loehle, daniel.lezcano; +Cc: aboorvad, linux-pm, linux-kernel

When a cpuidle driver registers only a single idle state, the ladder
governor can compute an out-of-bounds index, leading to a NULL pointer
dereference in cpuidle_enter_state().

Patch 1 fixes this by adding a bail-out in cpuidle_select() that
bypasses the governor entirely when state_count <= 1.

Patches 2-4 remove the now-redundant single-state handling from the
haltpoll, teo, and menu governors.

v1:
https://lore.kernel.org/all/20260211053552.739337-1-aboorvad@linux.ibm.com/

v1 -> v2:
- Move fix to cpuidle_select() core bail-out instead of ladder governor
- Remove redundant single-state handling from menu, teo, haltpoll

Aboorva Devarajan (2):
  cpuidle: Skip governor when only one idle state is available
  cpuidle: haltpoll: Remove single state handling

Christian Loehle (2):
  cpuidle: teo: Remove single state handling
  cpuidle: menu: Remove single state handling

 drivers/cpuidle/cpuidle.c            | 10 ++++++++++
 drivers/cpuidle/governors/haltpoll.c |  2 +-
 drivers/cpuidle/governors/menu.c     |  2 +-
 drivers/cpuidle/governors/teo.c      |  6 ------
 4 files changed, 12 insertions(+), 8 deletions(-)

-- 
2.52.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-05 17:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-16 18:50 [PATCH v2 0/4] cpuidle: Fix crash with single idle state Aboorva Devarajan
2026-02-16 18:50 ` [PATCH v2 1/4] cpuidle: Skip governor when only one idle state is available Aboorva Devarajan
2026-02-17 14:36   ` Christian Loehle
2026-02-17 14:53     ` Rafael J. Wysocki
2026-03-05 16:53   ` Guenter Roeck
2026-03-05 17:06     ` Rafael J. Wysocki
2026-03-05 17:09       ` Guenter Roeck
2026-02-16 18:50 ` [PATCH v2 2/4] cpuidle: haltpoll: Remove single state handling Aboorva Devarajan
2026-02-17 14:37   ` Christian Loehle
2026-02-16 18:50 ` [PATCH v2 3/4] cpuidle: teo: " Aboorva Devarajan
2026-02-16 18:50 ` [PATCH v2 4/4] cpuidle: menu: " Aboorva Devarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®