From: Greg KH <gregkh@linuxfoundation.org>
To: Soham Kute <officialsohamkute@gmail.com>
Cc: jirislaby@kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org,
syzbot+03f79366754268a0f20c@syzkaller.appspotmail.com
Subject: Re: [PATCH] tty: vt: keyboard: fix general protection fault in k_meta
Date: Thu, 12 Mar 2026 14:51:58 +0100 [thread overview]
Message-ID: <2026031245-atop-lankiness-4e0c@gregkh> (raw)
In-Reply-To: <20260207192708.44188-1-officialsohamkute@gmail.com>
On Sun, Feb 08, 2026 at 12:57:08AM +0530, Soham Kute wrote:
> syzbot reported a general protection fault in k_meta() caused by
> dereferencing an invalid keyboard pointer when checking META mode.
>
> Add a defensive check to ensure the keyboard pointer is valid before
> calling vc_kbd_mode().
How can kbd be NULL here? What causes that to happen?
>
> Reported-by: syzbot+03f79366754268a0f20c@syzkaller.appspotmail.com
>
> Signed-off-by: Soham Kute <officialsohamkute@gmail.com>
> ---
> drivers/tty/vt/keyboard.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index d65fc60dd..b535d7a42 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -880,7 +880,7 @@ static void k_meta(struct vc_data *vc, unsigned char value, char up_flag)
> if (up_flag)
> return;
>
> - if (vc_kbd_mode(kbd, VC_META)) {
> + if (kbd && vc_kbd_mode(kbd, VC_META)) {
What prevents kbd from being NULL _right_ after you check it? There's
no locking here at all...
Perhaps fix the root problem here?
thanks,
greg k-h
prev parent reply other threads:[~2026-03-12 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 19:27 [PATCH] tty: vt: keyboard: fix general protection fault in k_meta Soham Kute
2026-03-12 13:51 ` Greg KH [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=2026031245-atop-lankiness-4e0c@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=officialsohamkute@gmail.com \
--cc=syzbot+03f79366754268a0f20c@syzkaller.appspotmail.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