From owner-svn-src-head@FreeBSD.ORG Mon Mar 23 01:13:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44487106566B; Mon, 23 Mar 2009 01:13:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 329648FC12; Mon, 23 Mar 2009 01:13:35 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2N1DY2N089920; Mon, 23 Mar 2009 01:13:34 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2N1DYaR089919; Mon, 23 Mar 2009 01:13:34 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200903230113.n2N1DYaR089919@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 23 Mar 2009 01:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190305 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 01:13:35 -0000 Author: kan Date: Mon Mar 23 01:13:34 2009 New Revision: 190305 URL: http://svn.freebsd.org/changeset/base/190305 Log: Add safety check that does not allow empty strings to be queued to the devctl notification queue. Empty strings cause devctl read call to return 0 and result in devd exiting prematurely. The actual offender (ugen notes for root hubs) will be fixed by separate commit. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Mar 23 00:40:07 2009 (r190304) +++ head/sys/kern/subr_bus.c Mon Mar 23 01:13:34 2009 (r190305) @@ -532,6 +532,12 @@ devctl_queue_data(char *data) struct dev_event_info *n1 = NULL; struct proc *p; + /* + * Do not allow empty strings to be queued, as they + * cause devd to exit prematurely. + */ + if (strlen(data) == 0) + return; n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT); if (n1 == NULL) return;