[clug] Causing a kernel oops

Martin Pool mbp at sourcefrog.net
Tue Sep 2 13:34:16 EST 2003


On  2 Sep 2003 Andrew Pollock <andrew-clug at andrew.net.au> wrote:

> Hi,
> 
> One of my colleagues was reading a security advisory about something
> that caused a kernel oops, and asked what a kernel oops was.

It looks just like this:

http://groups.google.com/groups?q=oops&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=
zJacne2kXr1yO8-iXTWJkw%40mbay.net&rnum=2

It is the equivalent of a BSOD.  The most common cause is a segmentation
violation in kernel mode caused by using a bad pointer, but there are
many other possibilities.  The root cause is a kernel bug or hardware
failure.  (It's probably about 50/50 between these in my experience,
if you're using sane kernel versions.)

Interesting enough if the oops applies to one particular process then
only that process will be killed, and you can continue.  You really
ought to reboot though, because some other kernel structures may have
been hit by shrapnel.

> I seem to recall reading somewhere in the past (Bugtraq) about a test 
> kernel module you could insert into a kernel that would cause an oops.

Yes, there is one.  The kdb kernel debugger patch will also let you
cause one.

A trivial implementation would just read address 0, or call panic() from
the module_init function.  Kaboom.

-- 
Martin 



More information about the linux mailing list