Skip to content

Commit d2917ff

Browse files
surenbaghdasaryanakpm00
authored andcommitted
lib/dump_stack: report process UID in dump_stack_print_info()
To make it easier to identify the crashing process, report effective UID when dumping the stack. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 326c34e commit d2917ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/dump_stack.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...)
5454
*/
5555
void dump_stack_print_info(const char *log_lvl)
5656
{
57-
printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT "\n",
58-
log_lvl, raw_smp_processor_id(), current->pid, current->comm,
57+
printk("%sCPU: %d UID: %u PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT "\n",
58+
log_lvl, raw_smp_processor_id(),
59+
__kuid_val(current_real_cred()->euid),
60+
current->pid, current->comm,
5961
kexec_crash_loaded() ? "Kdump: loaded " : "",
6062
print_tainted(),
6163
init_utsname()->release,

0 commit comments

Comments
 (0)