mm/kmemleak: use %pK to display kernel pointers in backtrace
authorClément Léger <clement.leger@bootlin.com>
Tue, 8 Nov 2022 09:43:22 +0000 (10:43 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 16 Dec 2022 00:37:49 +0000 (16:37 -0800)
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 <clement.leger@bootlin.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmemleak.c

index dc7db6a2a0ddddac0e155e6625ee91701850b4c6..92f670edbf518710eed9aef6e115afe6f4b07c1f 100644 (file)
@@ -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);
        }
 }