This might sound strange, as people usually want to fix or prevent their computer from kernel panicing, but I was trying to test / create a method of logging kernel panic messages to a remote logging server. All of the existing tutorials I found on the net were for Linux kernel version 2.4, or were incomplete.
My method involves creating a Linux kernel module, that when it’s inserted, causes the panic.
Here’s my my tarball: (includes the module source and a makefile)
Here’s how to compile it: (you’ll need the the build kernel sources installed at /usr/src/linux of your current running kernel version)
make -C /lib/modules/$(uname -r)/build M=$(pwd)
After it’s done compiling: (WARNING, THIS WILL CRASH THE MACHINE, and you need to be root)
To recover from the crash, just reboot your computer.
Let me know if this is any good in the comments, and any improvements I can make!
Should I obfuscate the source code at all to prevent misuse of this? Since you need root access to insert a kernel module, and anyone with root access can halt the machine, I find the ramifications of releasing this information moot. Comment!
Here’s where I found a quick howto on creating a Linux 2.6 kernel module: