Re: [PATCH] x86/boot: Reject truncated acpi_rsdp= values
From: Thorsten Blum
Date: Thu Jun 18 2026 - 11:04:03 EST
On Wed, Jun 17, 2026 at 09:54:00PM -0700, Borislav Petkov wrote:
> On Wed, Jun 17, 2026 at 03:04:18PM +0200, Thorsten Blum wrote:
> > cmdline_find_option() returns the full length of the argument value even
> > if it is truncated. However, get_cmdline_acpi_rsdp() only checks whether
> > acpi_rsdp= is present and does not reject truncated values that do not
> > fit in the buffer.
> >
> > Reject truncated values early to prevent boot_kstrtoul() from parsing a
> > partial value and thus from silently using the wrong RSDP address.
>
> And?
>
> If it uses the wrong address, it'll crash'n'burn later. As it should be.
The problem is that we don't necessarily use the user-supplied address.
get_cmdline_acpi_rsdp() can truncate it into a different, parseable
address and use that instead. That might not crash at all.
We already return 0 and fail gracefully when boot_kstrtoul() cannot
parse the value; this does the same when cmdline_find_option() reports
the value was truncated because it didn't fit the buffer.