svn commit: r190305 - head/sys/kern

Alexander Kabaev kan at FreeBSD.org
Sun Mar 22 18:13:35 PDT 2009


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;


More information about the svn-src-head mailing list