Skip to content

Commit

Permalink
mm/kmemleak: use %pK to display kernel pointers in backtrace
Browse files Browse the repository at this point in the history
Currently, %p is used to display kernel pointers in backtrace which result
in a hashed value that is not usable to correlate the address for debug. 
Use %pK which will respect the kptr_restrict configuration value and thus
allow to extract meaningful information from the backtrace.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Clément Léger <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
clementleger authored and akpm00 committed Dec 16, 2022
1 parent 56a6161 commit 3a6f33d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static void print_unreferenced(struct seq_file *seq,

for (i = 0; i < nr_entries; i++) {
void *ptr = (void *)entries[i];
warn_or_seq_printf(seq, " [<%p>] %pS\n", ptr, ptr);
warn_or_seq_printf(seq, " [<%pK>] %pS\n", ptr, ptr);
}
}

Expand Down

0 comments on commit 3a6f33d

Please sign in to comment.