Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 2009 01:13:34 +0000 (UTC)
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190305 - head/sys/kern
Message-ID:  <200903230113.n2N1DYaR089919@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903230113.n2N1DYaR089919>