mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
tty/vt: prevent registration of console with invalid number
If a user specifies an invalid console like 'console=tty3000', the vt driver should prevent setting up a vt entry for that. Suggested-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Link: https://lore.kernel.org/r/20221209112737.3222509-3-svens@linux.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
db4df8e9d7
commit
7370a25f93
|
|
@ -3156,8 +3156,14 @@ static struct tty_driver *vt_console_device(struct console *c, int *index)
|
|||
return console_driver;
|
||||
}
|
||||
|
||||
static int vt_console_setup(struct console *co, char *options)
|
||||
{
|
||||
return co->index >= MAX_NR_CONSOLES ? -EINVAL : 0;
|
||||
}
|
||||
|
||||
static struct console vt_console_driver = {
|
||||
.name = "tty",
|
||||
.setup = vt_console_setup,
|
||||
.write = vt_console_print,
|
||||
.device = vt_console_device,
|
||||
.unblank = unblank_screen,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user