[syslinux] Proposed fix: syslinux

H. Peter Anvin hpa at zytor.com
Fri Sep 29 16:10:28 PDT 2023


On September 29, 2023 3:57:04 PM PDT, Luiz Carlos Ramos <lramos.prof at yahoo.com.br> wrote:
>Hello,
>
>my name is Luiz Ramos. I work in Brazil and causually had to pay
>attention to some bits of the Syslinux project, ultimately having found
>what I think it's a bug.
>
>The problem shows itself as an inability of the loaded Linux kernel
>to access all the memory the machine has. This is due to the fact that
>there is an issue in the exit_boot() routine, that prevents it from
>searching for memory chunks above id 128 (i.e., E820MAX).
>
>Below I propose a patch which hopefully solves the problem (or at least,
>solved my case):
>
>=== patch ============================================================
>diff --git a/efi/main.c b/efi/main.c
>index 6a748412..ce8f21ec 100644
>--- a/efi/main.c
>+++ b/efi/main.c
>@@ -1034,7 +1034,7 @@ static int exit_boot(struct boot_params *bp)
> 	 * interim.
> 	 */
> 	e = e820buf = bp->e820_map;
>-	for (i = 0; i < nr_entries && i < E820MAX; i++) {
>+	for (i = 0; i < nr_entries; i++) {
> 		struct e820_entry *prev = NULL;
> 
> 		if (e > e820buf)
>@@ -1083,8 +1083,11 @@ static int exit_boot(struct boot_params *bp)
> 		if (prev && (prev->start + prev->len) == e->start &&
> 		    prev->type == e->type)
> 			prev->len += e->len;
>-		else
>+		else {
> 			e++;
>+			if (e > &e820_type[E820MAX-1])
>+				break;
>+		}
> 	}
> 
> 	bp->e820_entries = e - e820buf;
>=== patch ============================================================
>
>Hope it may help,
>Luiz Carlos Ramos
>lramos.prof at yahoo.com.br
>

Yikes. What machine do you have that has more than 128 chunks and actually need them to boot?



More information about the Syslinux mailing list