Re: [PATCH v2 1/2] printk: Check valid console index for preferred console

From: Tony Lindgren
Date: Wed Oct 11 2023 - 05:18:11 EST


* Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> [231011 07:53]:
> On Wed, Oct 11, 2023 at 10:43:25AM +0300, Tony Lindgren wrote:
> > Let's check for valid console index values to avoid bogus console index
> > numbers from kernel command line. While struct console uses short for
> > index, and negative index values are used by some device drivers, we do
> > not want to allow negative values for preferred console.
>
> What drivers use a negative index for the console?

This is based on grepping with $ git grep "co->index =" drivers/tty/

Not sure what all might be stopping making struct console index unsigned.

Regards,

Tony