linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/kmemleak: use %pK to display kernel pointers in backtrace
@ 2022-11-08  9:43 Clément Léger
  0 siblings, 0 replies; only message in thread
From: Clément Léger @ 2022-11-08  9:43 UTC (permalink / raw)
  To: Catalin Marinas, Andrew Morton
  Cc: linux-mm, linux-kernel, Thomas Petazzoni, Alexandre Belloni,
	Clément Léger

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.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 mm/kmemleak.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 646e2979641f..b16be8891ae3 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -358,7 +358,7 @@ static void print_unreferenced(struct seq_file *seq,
 
 	for (i = 0; i < object->trace_len; i++) {
 		void *ptr = (void *)object->trace[i];
-		warn_or_seq_printf(seq, "    [<%p>] %pS\n", ptr, ptr);
+		warn_or_seq_printf(seq, "    [<%pK>] %pS\n", ptr, ptr);
 	}
 }
 
-- 
2.38.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-08  9:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  9:43 [PATCH] mm/kmemleak: use %pK to display kernel pointers in backtrace Clément Léger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox