The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Cen Zhang <zzzccc427@gmail.com>
Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, baijiaju1990@gmail.com
Subject: Re: [PATCH] vt: keyboard: serialize KDGETLED with keyboard_tasklet
Date: Sun, 10 May 2026 18:21:48 +0200	[thread overview]
Message-ID: <2026051001-peso-enamel-2e62@gregkh> (raw)
In-Reply-To: <20260510031348.1922157-1-zzzccc427@gmail.com>

On Sun, May 10, 2026 at 11:13:48AM +0800, Cen Zhang wrote:
> KDGETLED reaches getledstate() and samples ledstate without serializing
> against keyboard_tasklet.
> 
> That is problematic because kbd_bh() temporarily stores ~leds into
> ledstate during a VT switch to force LED propagation before committing
> the final value.  An unlocked KDGETLED can therefore observe that
> internal sentinel instead of the last committed LED state.

Why is that an issue?

> Other ledstate readers in this file already quiesce keyboard_tasklet
> before sampling the value.  Do the same in getledstate() so the ioctl
> only returns a stable snapshot.

stable for "what" exactly?  This is a snapshot in time, be it before or
after it changes is not always going to really matter here, as it can
change right after you "enable" the tasklet, right?

thanks,

greg k-h

  reply	other threads:[~2026-05-10 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10  3:13 [PATCH] vt: keyboard: serialize KDGETLED with keyboard_tasklet Cen Zhang
2026-05-10 16:21 ` Greg KH [this message]
2026-05-10 16:43   ` Cen Zhang
2026-05-10 16:55     ` Greg KH
2026-05-10 17:01       ` Cen Zhang

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=2026051001-peso-enamel-2e62@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=baijiaju1990@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=zzzccc427@gmail.com \
    /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