From: Soham Kute <officialsohamkute@gmail.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Soham Kute <officialsohamkute@gmail.com>,
syzbot+03f79366754268a0f20c@syzkaller.appspotmail.com
Subject: [PATCH] tty: vt: keyboard: fix general protection fault in k_meta
Date: Sun, 8 Feb 2026 00:57:08 +0530 [thread overview]
Message-ID: <20260207192708.44188-1-officialsohamkute@gmail.com> (raw)
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().
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)) {
put_queue(vc, '\033');
put_queue(vc, value);
} else
--
2.34.1
next reply other threads:[~2026-02-07 19:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 19:27 Soham Kute [this message]
2026-03-12 13:51 ` [PATCH] tty: vt: keyboard: fix general protection fault in k_meta Greg KH
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=20260207192708.44188-1-officialsohamkute@gmail.com \
--to=officialsohamkute@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--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