Bug 25130

Summary: kernel crash with kldload/kldunload md.ko
Product: Base System Reporter: davidx <davidx>
Component: kernAssignee: dcs <dcs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   

Description davidx 2001-02-16 06:20:01 UTC
when I kldload and kldunload malloc disk module md.ko, kernel crashed.
blah, blah, ....

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x4
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc01565cf
stack pointer           = 0x10:0xcc972ed8
frame pointer           = 0x10:0xcc972ed8
code segment            = base rx0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 268(kldunload)
interrupt mask          = none
trap number             = 12
panic: page fault

syncing disks... 41 40 12 7 5
done
Uptime: 43s
Automatic reboot in 15 seconds - press a key on console to abort

How-To-Repeat: # kldload md
# kldunload md

blah, blah, ....
Comment 1 Kris Kennaway 2001-02-20 11:10:34 UTC
On Thu, Feb 15, 2001 at 10:15:33PM -0800, davidx@viasoft.com.cn wrote:

> >Originator:     David Xu
> >Release:        FreeBSD 4.2-RELEASE

                   ^^^^^^^^^^^^^^^^^^^

> when I kldload and kldunload malloc disk module md.ko, kernel crashed.
> blah, blah, ....

md(4) isn't in 4.x.  If you're trying to kldload a module built under
-current in 4.x, it won't work.  Is this the case?

Kris
Comment 2 dcs freebsd_committer freebsd_triage 2001-02-22 09:41:01 UTC
Responsible Changed
From-To: freebsd-bugs->dcs

I'm working on it right now.
Comment 3 dcs freebsd_committer freebsd_triage 2001-02-24 16:46:22 UTC
State Changed
From-To: open->feedback

Patches have been committed. If no further problems are detected, 
I'm going to close this PR.
Comment 4 davidx 2001-03-05 04:22:14 UTC
Hello Brad,

Monday, March 05, 2001, 3:42:24 AM, you wrote:

BL>  > >Originator:     David Xu
BL>  > >Release:        FreeBSD 4.2-RELEASE
 
BL>                     ^^^^^^^^^^^^^^^^^^^
 
BL>  > when I kldload and kldunload malloc disk module md.ko, kernel crashed.
BL>  > blah, blah, ....

BL> You have the following in your kernel config file - it is enabled in the GENERIC kernel
BL> by default, and is easily missed:

BL> pseudo-device md                # Memory "disks"

BL> I was able to reproduce the kernel panic with that option enabled in the config file.
BL> The kernel bails out for obvious reasons; removing this option enables safe loading and
BL> unloading of this module.

BL> What is needed is a safety against loading a kernel module with code which already exists
BL> in the BSD kernel itself; I've seen similar issues where modules are not prevented from 
BL> loading, particularly in my PPPoE setup (ng_pppoe.ko).

BL> Cheers,
BL> Brad

Yeah, you are genius.

-- 
Best regards,
 David Xu                           mailto:davidx@viasoft.com.cn
Comment 5 dwmalone freebsd_committer freebsd_triage 2001-11-02 14:41:32 UTC
State Changed
From-To: feedback->closed

Remaining issues are a duplicate of PR 24392.