ia64/77591: Case of pointer to FPSWA being NULL not correctly handled

Christian Kandeler christian.kandeler at hob.de
Wed Feb 16 01:50:11 PST 2005


>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:


More information about the freebsd-ia64 mailing list