Re: [PATCH v9] /proc/sysrq-trigger: accept multiple keys at once

From: Jiri Slaby
Date: Mon Nov 20 2023 - 02:45:46 EST


On 15. 11. 23, 11:34, Tomas Mudrunka wrote:
Just for convenience.
This way we can do:
`echo _reisub > /proc/sysrq-trigger`
Instead of:
`for i in r e i s u b; do echo "$i" > /proc/sysrq-trigger; done;`

This can be very useful when trying to execute sysrq combo remotely
or from userspace. When sending keys in multiple separate writes,
userspace can be killed before whole combo is completed.
Therefore putting all keys in single write is more robust approach.

Signed-off-by: Tomas Mudrunka <tomas.mudrunka@xxxxxxxxx>
---
V8 -> V9: Fixed english bit more

Please check my comments to v6 more carefully once again. Plus:

--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -1150,16 +1150,28 @@ EXPORT_SYMBOL(unregister_sysrq_key);
#ifdef CONFIG_PROC_FS
/*
* writing 'C' to /proc/sysrq-trigger is like sysrq-C
+ * Normally only the first character written is processed.

Normally, <-- comma

+ * If first character is underscore, all characters are processed.

the first
an underscore

Maybe it would make sense to prepend "However, " to this very sentence?

thanks,
--
js
suse labs