There's an off-by-1 in kernel/power/main.c:state_store() ... if your kernel just happens to have some non-zero data at pm_states[PM_SUSPEND_MAX] (i.e. one past the end of the array) then it'll let you write anything you want to /sys/power/state and in response the box will enter S5.
Unified · Split
| @@ -272,7 +272,7 @@ static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n · 271 unmodified lines | ||
| 272 | 272 | if (*s && !strncmp(buf, *s, len)) |
| 273 | 273 | break; |
| 274 | 274 | } |
| 275 | − if (*s) | |
| 275 | + if (state < PM_SUSPEND_MAX && *s) | |
| 276 | 276 | error = enter_state(state); |
| 277 | 277 | else |
| 278 | 278 | error = -EINVAL; |