Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 2008 12:20:43 GMT
From:      Sergey Matveychuk <sem@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/121427: kldload crash system when specified not-file argument (device, etc.)
Message-ID:  <200803061220.m26CKhtZ012737@www.freebsd.org>
Resent-Message-ID: <200803061230.m26CU1Q4082769@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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