Skip to content

Commit

Permalink
um: Prevent KASAN splats in dump_stack()
Browse files Browse the repository at this point in the history
Use READ_ONCE_NOCHECK() when reading the stack to prevent KASAN splats
when dump_stack() is used.

Fixes: 5b30140 ("UML: add support for KASAN under x86_64")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Vincent Whitchurch authored and Richard Weinberger committed Sep 19, 2022
1 parent 782b1f7 commit 2975e4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/um/kernel/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ void show_stack(struct task_struct *task, unsigned long *stack,
break;
if (i && ((i % STACKSLOTS_PER_LINE) == 0))
pr_cont("\n");
pr_cont(" %08lx", *stack++);
pr_cont(" %08lx", READ_ONCE_NOCHECK(*stack));
stack++;
}

printk("%sCall Trace:\n", loglvl);
Expand Down

0 comments on commit 2975e4a

Please sign in to comment.