* loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Make sure that
ADDR_MAX does not exceed GRUB_LINUX_INITRD_MAX_ADDRESS.
+2006-06-09 Yoshinori K. Okuji <okuji@enbug.org>
+
+ * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Make sure that
+ ADDR_MAX does not exceed GRUB_LINUX_INITRD_MAX_ADDRESS.
+
2006-06-07 Jeroen Dekkers <jeroen@dekkers.cx>
* include/grub/types.h (grub_host_addr_t): Rename to
/* Get the highest address available for the initrd. */
if (grub_le_to_cpu16 (lh->version) >= 0x0203)
- addr_max = grub_cpu_to_le32 (lh->initrd_addr_max);
+ {
+ addr_max = grub_cpu_to_le32 (lh->initrd_addr_max);
+
+ /* XXX in reality, Linux specifies a bogus value, so
+ it is necessary to make sure that ADDR_MAX does not exceed
+ 0x3fffffff. */
+ if (addr_max > GRUB_LINUX_INITRD_MAX_ADDRESS)
+ addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;
+ }
else
addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;