Re: [PATCH v4 1/2] tty: sysrq: don't expose a partially written reset_seq

From: Zhan Xusheng

Date: Fri Oct 30 2026 - 02:31:44 EST


Hi Greg,

On Fri, Oct 30, 2026 at 07:05:10AM +0100, Greg KH wrote:
> I'm sorry, but I can't really parse this llm-generated text. What is
> the bug here. What is being fixed? And what is changing?

Sorry, that was unreadable.

reset_seq can be changed at runtime, but the new value doesn't work:
each keyboard keeps counting the old keys too, so pressing the new
sequence does nothing. 2/2 fixes that.

1/2 is for a race that 2/2 makes easier to hit. The new list is filled
in one key at a time and the keyboards pick up each partial list, so
pressing the first new key during the write can reboot the machine.

> And how has no one ever hit this issue in the decades that it has been
> present? Is this really something that needs to be fixed? If so, why?

The sequence is usually set on the command line or in DT, and that
works. Both bugs need a runtime change, and the race also needs a key
press during the write, which takes microseconds. I only hit it with
an added delay.

1/2 is far too big for that. Telling the keyboards about the new value
only once the whole list is written avoids the race with a small patch,
and doesn't change what the parameter accepts. I can send that with
2/2 as v5, or drop the series if runtime changes aren't worth fixing.

Thanks,
Zhan Xusheng