Re: [PATCH] initrd: Fix virtual/physical mix-up in overwrite test

From: Roman Zippel
Date: Sun Dec 16 2007 - 23:14:39 EST


Hi,

On Sunday 16 December 2007, Geert Uytterhoeven wrote:

> --- a/init/main.c
> +++ b/init/main.c
> @@ -598,9 +598,9 @@ asmlinkage void __init start_kernel(void
>
> #ifdef CONFIG_BLK_DEV_INITRD
> if (initrd_start && !initrd_below_start_ok &&
> - initrd_start < min_low_pfn << PAGE_SHIFT) {
> + virt_to_pfn(initrd_start) < min_low_pfn) {
> printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
> - "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
> + "disabling it.\n", virt_to_pfn(initrd_start), min_low_pfn);
> initrd_start = 0;
> }
> #endif

BTW this is some really old code, so another option might be to remove this
check completely as the same check is already done via bootmem.

bye, Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/