From: Clément Léger Date: Tue, 8 Nov 2022 09:43:22 +0000 (+0100) Subject: mm/kmemleak: use %pK to display kernel pointers in backtrace X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3a6f33d86baa8103c80f62edd9393e9f7bf25d72;p=linux.git mm/kmemleak: use %pK to display kernel pointers in backtrace 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/20221108094322.73492-1-clement.leger@bootlin.com Signed-off-by: Clément Léger Cc: Alexandre Belloni Cc: Catalin Marinas Cc: Thomas Petazzoni Signed-off-by: Andrew Morton --- diff --git a/mm/kmemleak.c b/mm/kmemleak.c index dc7db6a2a0ddd..92f670edbf518 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -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); } }