Linux Serial subsystem development
 help / color / mirror / Atom feed
* [BUG] tty: sysrq: duplicate input handler registration on v7.4-rc5
@ 2026-12-02  8:18 Rahul Priolkar
  2026-12-02  9:00 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Rahul Priolkar @ 2026-12-02  8:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-serial, linux-kernel, Dmitry Torokhov, linux-input

Hello,

On Linux v7.4-rc5 (fe6ff8d5d675), we observed duplicate entries for
the SysRq input handler on a defconfig-based x86_64 guest. In each
trial, we updated kernel.sysrq and checked /proc/bus/input/handlers
for exactly one SysRq entry. With concurrent updates, the handler
appeared 60 times in one listing after 98 trials. Updating kernel.sysrq
requires root in the initial user namespace.

Our reading of drivers/tty/sysrq.c is that sysrq_toggle_support() can
register the static handler twice because the enable-state check and
registration are not serialized. Does that match your understanding of
the failure?

A debug build with DEBUG_LIST and BUG_ON_DATA_CORRUPTION stopped in
the first run. The relevant frames were:

  kernel BUG at lib/list_debug.c:37!
  RIP: 0010:__list_add_valid_or_report
   input_register_handler
   sysrq_register_handler
   sysrq_sysctl_handler

On the unmodified kernel, we ran the updates one at a time as a
control. All 3,000 trials showed exactly one handler entry. We then
tested an rc5 build that included a mutex around sysrq_toggle_support()
along with our other candidate fixes. Across 6,000 concurrent-update
trials, we saw no duplicate entries or kernel warnings. I can share
the candidate patch if useful.

Thanks,
Rahul Priolkar

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

end of thread, other threads:[~2026-12-02  9:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  8:18 [BUG] tty: sysrq: duplicate input handler registration on v7.4-rc5 Rahul Priolkar
2026-12-02  9:00 ` Greg Kroah-Hartman
2026-12-02  9:23   ` [PATCH] tty: sysrq: serialize sysrq_toggle_support() Rahul Priolkar
2026-12-02  9:36     ` sashiko-bot
2026-12-02  9:47     ` Greg Kroah-Hartman
2026-12-02  9:57     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox