Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 22:32:58 +0200 (CEST)
From:      Espen Skoglund <esk@ira.uka.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ia64/39415: Bootloader assuming 8KB buffer when only 4KB is allocated
Message-ID:  <200206142032.g5EKWwk2016168@i30nb20.ira.uka.de>

next in thread | raw e-mail | index | archive | help

>Number:         39415
>Category:       ia64
>Synopsis:       Bootloader assuming 8KB buffer when only 4KB is allocated
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ia64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 17 06:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Espen Skoglund
>Release:        FreeBSD 5.0-CURRENT ia64
>Organization:
Karlsruhe University
>Environment:


>Description:

The AllocatePages() call in sys/boot/efi/libefi/elf_freebsd.c only
allocate one 4KB page.  The bi_load() in sys/boot/efi/libefi/bootinfo.c,
however, assumes that 8KB has been allocated when stashing the EFI memory
map behind the bootinfo.  This could lead to "interesting" behaviour
in certain (albeit probably unlikely) scenarios.

>How-To-Repeat:


>Fix:

Make sure that 8KB are allocated instead of only 4KB.

--- elf_freebsd.c.orig	Fri Jun 14 22:21:42 2002
+++ elf_freebsd.c	Fri Jun 14 22:22:13 2002
@@ -151,7 +151,7 @@
 	hdr = (Elf_Ehdr *)&(md->md_data);
 
 	status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
-	    EFI_SIZE_TO_PAGES(sizeof(struct bootinfo)), (void*)&bi);
+				   8192/4096, (void*)&bi);
 	if (EFI_ERROR(status)) {
 		printf("unable to create bootinfo block (status=0x%lx)\n",
 		    (long)status);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206142032.g5EKWwk2016168>