From owner-freebsd-bugs Fri Feb 1 17: 0:47 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E9E4C37B419 for ; Fri, 1 Feb 2002 17:00:00 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g12100p53252; Fri, 1 Feb 2002 17:00:00 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A323737B402 for ; Fri, 1 Feb 2002 16:52:25 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g120qPS52461; Fri, 1 Feb 2002 16:52:25 -0800 (PST) (envelope-from nobody) Message-Id: <200202020052.g120qPS52461@freefall.freebsd.org> Date: Fri, 1 Feb 2002 16:52:25 -0800 (PST) From: "Marcus L. Reid" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/34544: Kernel crash on fclose() of /dev/kbd1 when USB keyboard is detached while file is open. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34544 >Category: kern >Synopsis: Kernel crash on fclose() of /dev/kbd1 when USB keyboard is detached while file is open. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 01 17:00:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Marcus L. Reid >Release: 4.5-RELEASE >Organization: Gampro >Environment: FreeBSD zork.punq.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Fri Feb 1 16:06:37 PST 2002 root@zork.punq.net:/usr/obj/home/archive/releases/RELENG_4_5/src/sys/ZORK i386 >Description: When a USB keyboard is detached while a process has /dev/kbd1 open, the machine crashes hard when the process tries to fclose() the file. >How-To-Repeat: int main(void) { FILE *fp; /* USB keyboard is attached. */ fp = fopen("/dev/kbd1", "r"); if(fp) { printf("Unplug the keyboard in the next 10 seconds.\n"); sleep(10); } else { fprintf(stderr, "Couldn't open /dev/kbd1\n"); exit(1); } /* USB keyboard is detached by now. */ fclose(fp); /* Boom. */ exit(0); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message