Kernel OOPS "Unable to handle kernel NULL pointer dereference"
OK... This one is quite unusual.
I wrote a simple mmap() routine so I could map some memory between the kernel and userland (I am doing some Netfilter hooks). The module works fine. It compiles and loads great. Once it has been loaded, everything still works. However, after I unload the module and run some other task (anything, ls, vi, gcc, doesn't matter), I get a nasty message "Unable to handle kernel NULL pointer dereference" and it locks up. I ran memtest86 and it appears to be fine. If you want the source code for the module, I'll post it. |
I don't think your module is fine if it's causing that problem. If this error occurs after the module is unloaded, you probably want to check your __exit routine to make sure that it's not screwing up any data structures in kernel space. Just out of curiousity, why can't you use the kernel routines copy_to_user and copy_from_user to pass data back and forth? Particularly if you don't have a lot of data to copy, that would probably be a lot safer.
|
I heard that copy_from_user was slow. I'm looking at a structure every time a packet comes in to see if whoever sent it has logged into the system.
Here's the code, just in case I've forgotten to clean something up... (It's really C, but I used php to give it the pretty colors) PHP Code:
|
Another thing I've found...
On kmalloc(), if I don't put in GFP_DMA, it gives me random Segmentation faults with a lot of registers & whatnot (I don't know what those are called...) but it doesn't crash. It also works normally when unloaded. |
All times are GMT -5. The time now is 04:25 AM. |