grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] grub-core/loader/i386: Fix initrd maximum address overflow


From: Daniel Kiper
Subject: Re: [PATCH] grub-core/loader/i386: Fix initrd maximum address overflow
Date: Tue, 6 Dec 2022 16:36:15 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Sun, Dec 04, 2022 at 08:25:09PM +0800, Jeremy Szu wrote:
> The current i386 initrd be limited under 1G memory and it works in most
> compressed initrd. (also initrd_addr_max case reported by kernel)
>
> addr = (addr_max - aligned_size) & ~0xFFF;
>
> Above line to calculate the reasonable address to store the initrd.
>
> However, if initrd size is greater than 1G (or initrd_addr_max), then it
> will get overflow, especially in x86_64 arch.
>
> Therefore, add a check point to prevent it overflow as well as having a
> debug log for complex story of initrd addresses.
>
> Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]