From ab12866f38f18e071995e52a067aa9aa8060e393 Mon Sep 17 00:00:00 2001 From: kan Date: Mon, 23 Mar 2009 01:13:34 +0000 Subject: 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. --- sys/kern/subr_bus.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/kern/subr_bus.c') diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 3c526a6..70531ef 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -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; -- cgit v1.1