Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Feb 2005 09:45:02 GMT
From:      Christian Kandeler <christian.kandeler@hob.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ia64/77591: Case of pointer to FPSWA being NULL not correctly handled
Message-ID:  <200502160945.j1G9j2xZ089124@www.freebsd.org>
Resent-Message-ID: <200502160950.j1G9oA4S091598@freefall.freebsd.org>

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

>Number:         77591
>Category:       ia64
>Synopsis:       Case of pointer to FPSWA being NULL not correctly handled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ia64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 16 09:50:10 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Christian Kandeler
>Release:        5.3
>Organization:
HOB
>Environment:
n/a (cannot boot)
>Description:
In sys/ia64/ia64/machdep.c, the physical address of the fpswa interface in the boot_info structure is unconditionally converted to a virtual address: 
  fpswa_interface = (FPSWA_INTERFACE*)IA64_PHYS_TO_RR7(bootinfo.bi_fpswa);
This will lead to invalid memory accesses if the original physical address was zero, causing the machine to crash very early in the boot process.
>How-To-Repeat:
Boot on a machine with no FPSWA built into the firmware.
>Fix:
Here is a patch. I know this web form should not be used to submit code, but since I'm not able to boot into the system, I cannot use the send-pr program.

--- sys/ia64/ia64/machdep.c	2004-09-09 10:03:19.000000000 +0000
+++ sys/ia64/ia64/machdep.c	2005-02-16 09:16:19.335945801 +0000
@@ -600,7 +600,8 @@
               printf("WARNING: loader(8) metadata is missing!\n");
 
         /* Get FPSWA interface */
-        fpswa_interface = (FPSWA_INTERFACE*)IA64_PHYS_TO_RR7(bootinfo.bi_fpswa);
+        fpswa_interface = (bootinfo.bi_fpswa != NULL) ?
+            (FPSWA_INTERFACE*) IA64_PHYS_TO_RR7(bootinfo.bi_fpswa) : NULL;
 
         /* Init basic tunables, including hz */
         init_param1();

>Release-Note:
>Audit-Trail:
>Unformatted:



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