Re: [RESEND][PATCH v2] register_console: prevent adding the sameconsole twice

From: Greg Kroah-Hartman
Date: Fri Aug 02 2013 - 06:36:39 EST

On Fri, Aug 02, 2013 at 12:23:34PM +0200, Andreas Bießmann wrote:
> This patch guards the console_drivers list to be corrupted. The
> for_each_console() macro insist on a strictly forward list ended by NULL:
> con0->next->con1->next->NULL
> Without this patch it may happen easily to destroy this list for example by
> adding 'earlyprintk' twice, especially on embedded devices where the early
> console is often a single static instance. This will result in the following
> list:
> con0->next->con0
> This in turn will result in an endless loop in console_unlock() later on by
> printing the first __log_buf line endlessly.
> Signed-off-by: Andreas Bießmann <andreas@xxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Kay Sievers <kay@xxxxxxxx>
> Cc: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx

It's a nice "feature", but I fail to see how this is worthy of going
into the stable tree, as it's not fixing a kernel error, only a typo by
a user.


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at