Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Always dump trace for specified task in show_stack

Currently, show_stack() always dumps the trace of the current task.
However, it should dump the trace of the specified task if one is
provided. Otherwise, things like running "echo t > sysrq-trigger"
won't work as expected.

Fixes: 970e51feaddb ("um: Add support for CONFIG_STACKTRACE")
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20241106103933.1132365-1-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Tiwei Bie and committed by
Johannes Berg
0f659ff3 51b39d74

+1 -1
+1 -1
arch/um/kernel/sysrq.c
··· 46 46 } 47 47 48 48 printk("%sCall Trace:\n", loglvl); 49 - dump_trace(current, &stackops, (void *)loglvl); 49 + dump_trace(task ?: current, &stackops, (void *)loglvl); 50 50 }