[PATCH v3 0/2] tty: sysrq: fix the reset sequence state kept per input device

From: Zhan Xusheng

Date: Tue Oct 20 2026 - 22:22:16 EST


From: Zhan Xusheng <zhanxusheng@xxxxxxxxxx>

Sashiko's review of v2 asked whether clearing reset_keybit could leave a
device with a permanently truncated reset sequence. It can, and the
answer turned out to matter more than I assumed when I first looked at it:
with the default sysrq_downtime_ms of 0 the truncated sequence reboots the
machine on a single keypress.

That outcome is already reachable without the v2 change, on a device that
has not parsed a sequence yet and therefore starts with an empty
reset_keybit. But v2 extends it to every device, because clearing the
bitmap turns what used to be a stale superset of the old and new keys into
a proper truncation. So the race is fixed first, in 1/2, and 2/2 is the
v2 patch unchanged.

Changes in v3:
- Added 1/2 so that a truncated parse no longer sticks (Sashiko).
- Added Fixes: to both patches.

Changes in v2:
- Retitled from "Input:" to "tty: sysrq:" (Greg Kroah-Hartman).
- Delete keyreset_timer, otherwise an already armed reset survives the
reparse (Sashiko).
- Added Cc: stable.

Zhan Xusheng (2):
tty: sysrq: reparse the reset sequence when its length changes
tty: sysrq: reset the per-device key state when reparsing reset_seq

drivers/tty/sysrq.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)


base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
--
2.43.0