Linux Input/HID development
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rahul Priolkar <rahul.priolkar@asu.edu>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org
Subject: Re: [BUG] tty: sysrq: duplicate input handler registration on v7.4-rc5
Date: Wed, 2 Dec 2026 10:00:47 +0100	[thread overview]
Message-ID: <2026120242-corridor-chase-3d79@gregkh> (raw)
In-Reply-To: <6b0fd458.e5646aef.135df4.76b7@mx.google.com>

On Wed, Dec 02, 2026 at 12:18:32AM -0800, Rahul Priolkar wrote:
> 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.

Always send a patch.

      reply	other threads:[~2026-12-02  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026120242-corridor-chase-3d79@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rahul.priolkar@asu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox