All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit ea5b41f9 authored by Luck, Tony's avatar Luck, Tony Committed by Ingo Molnar

lockdep: Avoid out of bounds array reference in save_trace()

ia64 found this the hard way (because we currently have a stub
for save_stack_trace() that does nothing). But it would be a
good idea to  be cautious in case a real save_stack_trace()
bailed out with an error before it set trace->nr_entries.
Signed-off-by: default avatarTony Luck <>
Acked-by: default avatarPeter Zijlstra <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent 722d0172
......@@ -386,7 +386,8 @@ static int save_trace(struct stack_trace *trace)
* complete trace that maxes out the entries provided will be reported
* as incomplete, friggin useless </rant>
if (trace->entries[trace->nr_entries-1] == ULONG_MAX)
if (trace->nr_entries != 0 &&
trace->entries[trace->nr_entries-1] == ULONG_MAX)
trace->max_entries = trace->nr_entries;
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