Skip to content

cpuidle: Fix crash with single idle state

Aboorva Devarajan linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 6 repliesIn review

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cpuidle: Skip governor when only one idle state is availabledrivers/cpuidle/cpuidle.c+10 -05 replies
2/4cpuidle: haltpoll: Remove single state handlingdrivers/cpuidle/governors/haltpoll.c+1 -11 reply
3/4cpuidle: teo: Remove single state handlingdrivers/cpuidle/governors/teo.c+0 -60 replies
4/4cpuidle: menu: Remove single state handlingdrivers/cpuidle/governors/menu.c+1 -10 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchChristian Loehle
1/4R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] cpuidle: Fix crash with single idle state

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/[email protected]/

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(-)
Signature · 1 line
2.52.0