]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
um: Always dump trace for specified task in show_stack
authorTiwei Bie <tiwei.btw@antgroup.com>
Wed, 6 Nov 2024 10:39:33 +0000 (18:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:19 +0000 (19:51 +0100)
[ Upstream commit 0f659ff362eac69777c4c191b7e5ccb19d76c67d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/kernel/sysrq.c

index 7452f70d50d06924dbe0039db140ca8a0d0db2db..34edf6b8b69d5a944950155079739274732c1b9d 100644 (file)
@@ -52,5 +52,5 @@ void show_stack(struct task_struct *task, unsigned long *stack,
        }
 
        printk("%sCall Trace:\n", loglvl);
-       dump_trace(current, &stackops, (void *)loglvl);
+       dump_trace(task ?: current, &stackops, (void *)loglvl);
 }