From nobody@FreeBSD.ORG Sat May 29 12:19:54 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 2D91914C97; Sat, 29 May 1999 12:19:54 -0700 (PDT)
Message-Id: <19990529191954.2D91914C97@hub.freebsd.org>
Date: Sat, 29 May 1999 12:19:54 -0700 (PDT)
From: aron@cs.rice.edu
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: kldload loads kernel modules even if there are conflicting definitions
X-Send-Pr-Version: www-1.0

>Number:         11928
>Category:       kern
>Synopsis:       kldload loads kernel modules even if there are conflicting definitions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 29 12:20:01 PDT 1999
>Closed-Date:    Fri Jul 20 15:26:22 PDT 2001
>Last-Modified:  Fri Jul 20 15:28:50 PDT 2001
>Originator:     Mohit Aron
>Release:        FreeBSD-3.2-Release
>Organization:
Rice University
>Environment:
FreeBSD luzern.cs.rice.edu 3.2-RELEASE FreeBSD 3.2-RELEASE #2: Fri May 28 15:22:48 CDT 1999     aron@luzern.cs.rice.edu:/usr/src/sys/compile/LUZERN  i386
>Description:
kldload loads a module even if the module contains data or function 
definitions that exist in the kernel. The modload in the lkm interface
used to refuse loading such modules unless such data or funtion definitions 
were localized to the module using 'symorder -c'. 

I am not sure whether the above behavior is a feature of the elf format.
If so, couldn't this lead to programming bugs where multiply defined
symbols in the module were actually supposed to fetched from the kernel ?
>How-To-Repeat:
Try putting the global defintion "int hz;"  in the C code for a kld
module (the example in /usr/share/examples/kld/syscall will do). The
kernel already contains a symbol "hz" that gives the clock frequency.
kldload will load the module without any complaints. 

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 15:26:22 PDT 2001 
State-Changed-Why:  

This PR discusses a problem with the old kernel module system, which 
has been replaced since 3.2-RELEASE. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=11928 
>Unformatted:
