From owner-freebsd-ia64@FreeBSD.ORG Wed Feb 16 09:50:11 2005 Return-Path: Delivered-To: freebsd-ia64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B72516A4CE for ; Wed, 16 Feb 2005 09:50:11 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0605643D49 for ; Wed, 16 Feb 2005 09:50:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1G9oAgi091599 for ; Wed, 16 Feb 2005 09:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1G9oA4S091598; Wed, 16 Feb 2005 09:50:10 GMT (envelope-from gnats) Resent-Date: Wed, 16 Feb 2005 09:50:10 GMT Resent-Message-Id: <200502160950.j1G9oA4S091598@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ia64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christian Kandeler Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DA6A16A4CE for ; Wed, 16 Feb 2005 09:45:03 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60F8343D2F for ; Wed, 16 Feb 2005 09:45:03 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1G9j3Hh089127 for ; Wed, 16 Feb 2005 09:45:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j1G9j2xZ089124; Wed, 16 Feb 2005 09:45:02 GMT (envelope-from nobody) Message-Id: <200502160945.j1G9j2xZ089124@www.freebsd.org> Date: Wed, 16 Feb 2005 09:45:02 GMT From: Christian Kandeler To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: ia64/77591: Case of pointer to FPSWA being NULL not correctly handled X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2005 09:50:11 -0000 >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: