]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lib/dump_stack: report process UID in dump_stack_print_info()
authorSuren Baghdasaryan <surenb@google.com>
Sat, 15 Jun 2024 04:13:58 +0000 (21:13 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:25:11 +0000 (22:25 -0700)
To make it easier to identify the crashing process, report effective UID
when dumping the stack.

Link: https://lkml.kernel.org/r/20240615041358.103791-1-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/dump_stack.c

index 8b6b70eaf949e67a608a95f9bb679007d5e142ea..1a996fbbf50a038829ee7b9439f9eabafa866ff3 100644 (file)
@@ -54,8 +54,10 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...)
  */
 void dump_stack_print_info(const char *log_lvl)
 {
-       printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT "\n",
-              log_lvl, raw_smp_processor_id(), current->pid, current->comm,
+       printk("%sCPU: %d UID: %u PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT "\n",
+              log_lvl, raw_smp_processor_id(),
+              __kuid_val(current_real_cred()->euid),
+              current->pid, current->comm,
               kexec_crash_loaded() ? "Kdump: loaded " : "",
               print_tainted(),
               init_utsname()->release,