Date: Sun, 24 Jul 2005 13:39:22 GMT From: Markus Wild <fbsd-lists@dudes.ch> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/83999: [patch] panic in fw_bus_explore due to NULL reference Message-ID: <200507241339.j6ODdMp0078409@www.freebsd.org> Resent-Message-ID: <200507241340.j6ODeOUF008674@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 83999 >Category: kern >Synopsis: [patch] panic in fw_bus_explore due to NULL reference >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 24 13:40:23 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Markus Wild >Release: current amd64 >Organization: >Environment: FreeBSD amd64.dudes.ch 7.0-CURRENT FreeBSD 7.0-CURRENT #29: Sat Jul 16 18:30:24 CEST 2005 mw@amd64.dudes.ch:/usr/obj/usr/src/sys/AMD64 amd64 >Description: Machine panics at fw_bus_explore+0x3f: testb $0x40,0x(%rax) with %rax being NULL. The problem is the line (1339): if (!fw_find_self_id(fc, fc->ongonode)->p0.link_active) { fw_find_self_id() can return 0 if it doesn't find the node. This is not taken into account with the above test. >How-To-Repeat: On this machine it was sufficient to load the firewire module to trigger the panic. A canopus ADV module was plugged into the firewire port. >Fix: diff -u -r1.80 firewire.c --- firewire.c 6 Jan 2005 01:42:41 -0000 1.80 +++ firewire.c 24 Jul 2005 13:37:09 -0000 @@ -1324,6 +1324,7 @@ uint32_t addr; struct fw_xfer *xfer; struct fw_pkt *fp; + union fw_self_id *fwsid; if(fc->status != FWBUSEXPLORE) return; @@ -1336,7 +1337,8 @@ /* check link */ /* XXX we need to check phy_id first */ - if (!fw_find_self_id(fc, fc->ongonode)->p0.link_active) { + fwsid = fw_find_self_id(fc, fc->ongonode); + if (!fwsid || !fwsid->p0.link_active) { if (firewire_debug) printf("node%d: link down\n", fc->ongonode); fc->ongonode++; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507241339.j6ODdMp0078409>