Skip to content

Commit bfeeeeb

Browse files
jmbergKAGA-KOKO
authored andcommitted
stacktrace: don't crash on invalid stack trace structs
This patch makes the stacktrace printout code \warn when the entries pointer is unset rather than crashing when trying to access it in an attempt to make it a bit more robust. I was saving a stacktrace into an skb and forgot to copy it across skb copies... I have since fixed the code, but it would have been easier had the kernel not crashed in an interrupt. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 75d3bce commit bfeeeeb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎kernel/stacktrace.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
1313
{
1414
int i, j;
1515

16+
if (WARN_ON(!trace->entries))
17+
return;
18+
1619
for (i = 0; i < trace->nr_entries; i++) {
1720
unsigned long ip = trace->entries[i];
1821

0 commit comments

Comments
 (0)