mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] tty: sysrq: fix the reset sequence state kept per input device
@ 2026-10-21  2:20 Zhan Xusheng
  2026-10-21  2:20 ` [PATCH v3 1/2] tty: sysrq: reparse the reset sequence when its length changes Zhan Xusheng
  2026-10-21  2:20 ` [PATCH v3 2/2] tty: sysrq: reset the per-device key state when reparsing reset_seq Zhan Xusheng
  0 siblings, 2 replies; 3+ messages in thread
From: Zhan Xusheng @ 2026-10-21  2:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Mathieu Poirier, Dmitry Torokhov, linux-serial, linux-kernel,
	Zhan Xusheng

From: Zhan Xusheng <zhanxusheng@xiaomi.com>

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


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

end of thread, other threads:[~2026-10-21  2:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  2:20 [PATCH v3 0/2] tty: sysrq: fix the reset sequence state kept per input device Zhan Xusheng
2026-10-21  2:20 ` [PATCH v3 1/2] tty: sysrq: reparse the reset sequence when its length changes Zhan Xusheng
2026-10-21  2:20 ` [PATCH v3 2/2] tty: sysrq: reset the per-device key state when reparsing reset_seq Zhan Xusheng

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®