kern/56570: Possible kernel panic while loading kernel module
Thomas Wintergerst
thomas at smtp.nordcom.net
Sun Sep 7 12:00:32 PDT 2003
>Number: 56570
>Category: kern
>Synopsis: Possible kernel panic while loading kernel module
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Sep 07 12:00:29 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Thomas Wintergerst
>Release: FreeBSD 5.1-RELEASE i386
>Organization:
none
>Environment:
System: FreeBSD lullog.lemur.nord.de 5.1-RELEASE FreeBSD 5.1-RELEASE #3: Mon Jul 28 20:18:13 CEST 2003 operator at lullog.lemur.nord.de:/usr/src/sys/i386/compile/LULLOG i386
As shown above FreeBSD 5.1-RELEASE, i386 platform.
>Description:
Assume kernel module "othmod" depends on "basemod". "basemod" declares
version number 2. "othmod" declares to depend on "basemod" between 1 and
3, 1 is preferred. The attempt to load "othmod" after "basemod" will
cause a kernel panic.
If "othmod" declared to depend only on "basemod" version 2 (exact
match), this would be not problem.
>How-To-Repeat:
Just create a kernel module that depends on another. The dependency
declaration must contain a preferred version other than the existing
one, but the minimum and maximum version must contain the available
version.
>Fix:
Just apply the following patch to "/usr/src/sys/kern/kern_linker.c":
*** kern_linker.c.org Mon Mar 3 23:53:35 2003
--- kern_linker.c Mon Jul 28 20:16:57 2003
***************
*** 1085,1091 ****
return (mod);
if (ver >= verinfo->md_ver_minimum &&
ver <= verinfo->md_ver_maximum &&
! ver > bestmod->version)
bestmod = mod;
}
return (bestmod);
--- 1085,1091 ----
return (mod);
if (ver >= verinfo->md_ver_minimum &&
ver <= verinfo->md_ver_maximum &&
! (bestmod == NULL || ver > bestmod->version))
bestmod = mod;
}
return (bestmod);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list