Abhishek Dave
Abhishek Dave

Reputation: 749

how to panic kernel from user land

I need to panic kernel after some operations are done and verify what operation did

Can some one help me to know if there is any way? I searched a lot but no luck

I am looking for some generic call

thanks in Advance!

Upvotes: 2

Views: 2981

Answers (2)

Jay D
Jay D

Reputation: 3307

Higher address range is mapped to the kernel. This if you write something there e.g. Say 0xFFFFFF7 kernel exits your process with a segmentation fault complaining that illegal memory location was accessed. In user land your process is more like a sand box and any illegal access of memory outside your process is fined with kernel killing your process with a segmentation fault violation.

To panic a kernel you can try to set some wrong hardware registers typically with invocation of a syscntl sys call.

Upvotes: 2

cnicutar
cnicutar

Reputation: 182619

You can try a sysrq trigger:

echo c > /proc/sysrq-trigger

'c' - Will perform a system crash by a NULL pointer dereference. A crashdump will be taken if configured.

Upvotes: 5

Related Questions