Commit 38628078 authored by Aaron Tomlin's avatar Aaron Tomlin Committed by Steven Rostedt

tracing: Add BUG_ON when stack end location is over written

It is difficult to detect a stack overrun when it
actually occurs.

We have observed that this type of corruption is often
silent and can go unnoticed. Once the corrupted region
is examined, the outcome is undefined and often
results in sporadic system crashes.

When the stack tracing feature is enabled, let's check
for this condition and take appropriate action.

Note: init_task doesn't get its stack end location

Link: default avatarAaron Tomlin <>
Signed-off-by: default avatarSteven Rostedt <>
parent 0dea6d52
......@@ -13,6 +13,7 @@
#include <linux/sysctl.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/magic.h>
#include <asm/setup.h>
......@@ -144,6 +145,8 @@ check_stack(unsigned long ip, unsigned long *stack)
BUG_ON(current != &init_task &&
*(end_of_stack(current)) != STACK_END_MAGIC);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment