Date: Fri, 26 Feb 1999 03:30:17 -0500 (EST) From: sab@yin.vegamuse.org To: FreeBSD-gnats-submit@freebsd.org Subject: i386/10273: Kernel crash with multiport serial enabled and misconfigured master port Message-ID: <199902260830.DAA17158@yang.vegamuse.org>
next in thread | raw e-mail | index | archive | help
>Number: 10273 >Category: i386 >Synopsis: Kernel crash with multiport serial enabled and misconfigured master port >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: Fri Feb 26 10:10:03 PST 1999 >Closed-Date: >Last-Modified: >Originator: Stephen Kiernan >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: BOCA 6-port multiport serial card >Description: When multiport serial card is enabled in the kernel (options COM_MULTIPORT) and the master port is setup incorrectly (read: not configured), the kernel will panic on boot when it tries setting up one of the multiport card serial ports. There is a section of the sioattach code in i386/isa/sio.c which assumes that find_isadev will return a non-NULL pointer to a struct isa_device. What will happen if the master port is not configured is find_isadev will return NULL and then the aforementioned section of code will access the id_irq structure member. This causes the kernel to panic due to a NULL pointer reference. >How-To-Repeat: Enabled multiport serial with multiport card installed. options COM_MULTIPORT Do not configure the master port with an irq Build the kernel and reboot. Watch the kernel try to set up the first multiport serial port and panic. >Fix: --- sio.c.orig Fri Feb 26 02:48:27 1999 +++ sio.c Fri Feb 26 02:58:09 1999 @@ -1027,13 +1027,15 @@ #ifdef COM_MULTIPORT if (COM_ISMULTIPORT(isdp)) { + struct isa_device *idev; com->multiport = TRUE; printf(" (multiport"); if (unit == COM_MPMASTER(isdp)) printf(" master"); printf(")"); - com->no_irq = find_isadev(isa_devtab_tty, &siodriver, - COM_MPMASTER(isdp))->id_irq == 0; + idev = find_isadev(isa_devtab_tty, &siodriver, + COM_MPMASTER(isdp)); + com->no_irq = (idev == NULL) || (idev->id_irq == 0); } #endif /* COM_MULTIPORT */ if (unit == comconsole) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902260830.DAA17158>