kern/121427: kldload crash system when specified not-file argument (device, etc.)

Sergey Matveychuk sem at FreeBSD.org
Thu Mar 6 12:30:01 UTC 2008


>Number:         121427
>Category:       kern
>Synopsis:       kldload crash system when specified not-file argument (device, etc.)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 06 12:30:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Matveychuk
>Release:        7.0-STABLE
>Organization:
Yandex LLC
>Environment:
FreeBSD purple.yandex.net 7.0-STABLE FreeBSD 7.0-STABLE #6: Thu Mar  6 12:05:52 MSK 2008     root at purple.yandex.net:/usr/obj/usr/src/sys/PURPLE  i386
>Description:
Kernel is crashed if you specify a device name instead of a file name for kldload.
A code for checking is present but did not call is a full path name specified.
>How-To-Repeat:
kldload /dev/null
>Fix:


Patch attached with submission follows:

--- sys/kern/kern_linker.c.orig	2008-03-06 11:56:15.000000000 +0300
+++ sys/kern/kern_linker.c	2008-03-06 12:05:04.000000000 +0300
@@ -1704,8 +1704,10 @@
 	int len;
 
 	/* qualified at all? */
-	if (index(name, '/'))
-		return (linker_strdup(name));
+	if ((cp = index(name, '/')) != NULL) {
+	    	len = strlen(++cp);
+		return (linker_lookup_file(name, cp - name, cp, len, NULL));
+	}
 
 	/* traverse the linker path */
 	len = strlen(name);


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list