Re: [PATCH RESEND 1/2] x86/boot: validate earlyprintk= baud rate
From: Thorsten Blum
Date: Fri May 15 2026 - 07:24:03 EST
Hi Dave,
On Wed, May 13, 2026 at 10:05:30AM -0700, Dave Hansen wrote:
> > Values greater than BASE_BAUD would produce divisor 0, and
> > baud 1 would produce divisor BASE_BAUD, which exceeds 16 bits.
>
> My inclination would be to leave this code as simple as possible. If
> users screw up a baud rate, they'll get no output and have to go fix it.
>
> Why does this need to be robust against bad user input?
OK, I guess any baud rate that doesn't crash or hang the system is
acceptable. Let's drop patch 1/2 then and I'll resend patch 2/2 as a
standalone patch.
I've also sent another patch yesterday that prevents the same division
by zero and thus early boot hang in early_serial_init() when using
console=uart8250:
https://lore.kernel.org/lkml/20260514143014.516303-3-thorsten.blum@xxxxxxxxx/
Thanks,
Thorsten