Re: [PATCH RESEND 1/3] x86/setup: Fix logged allocation range in relocate_initrd()
From: Borislav Petkov
Date: Sun Nov 15 2026 - 11:06:15 EST
On Wed, Nov 11, 2026 at 05:56:08PM +0100, Thorsten Blum wrote:
> Since commit c967da6a0ba8 ("x86: Make sure free_init_pages() frees pages
> on page boundary"), relocate_initrd() allocates area_size bytes, which
> is ramdisk_size rounded up to a page boundary. However, the log still
> uses the potentially smaller ramdisk_size to calculate the end of the
> allocated range and can report it as too short.
>
> Use area_size instead.
>
> Fixes: c967da6a0ba8 ("x86: Make sure free_init_pages() frees pages on page boundary")
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> arch/x86/kernel/setup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 19fc8e1714e6..4a6c54110e75 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -334,7 +334,7 @@ static void __init relocate_initrd(void)
> initrd_start = relocated_ramdisk + PAGE_OFFSET;
> initrd_end = initrd_start + ramdisk_size;
> printk(KERN_INFO "Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
> - relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
> + relocated_ramdisk, relocated_ramdisk + area_size - 1);
>
> ret = copy_from_early_mem((void *)initrd_start, ramdisk_image, ramdisk_size);
> if (ret)
What about the rest of the code in that function still using ramdisk_size? But
reserve_initrd() using the page-aligned size?
Looks to me like this should be unified.
And that unification patch should contain all your other micro changes.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette