]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
uprobes: Don't use %pK through printk
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 17 Feb 2025 07:43:35 +0000 (08:43 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 18 Feb 2025 08:48:02 +0000 (09:48 +0100)
Restricted pointers ("%pK") are not meant to be used through printk().
It can unintentionally expose security sensitive, raw pointer values.

Use regular pointer formatting instead.

For more background, see:

  https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250217-restricted-pointers-uprobes-v1-1-e8cbe5bb22a7@linutronix.de
kernel/events/uprobes.c

index 2ca797cbe465f2d4a596e4a5d0d2d5a45e5cacf9..bf2a87a0a37878e99d0cf715ddedfdc2d1949c5d 100644 (file)
@@ -417,7 +417,7 @@ static void update_ref_ctr_warn(struct uprobe *uprobe,
                                struct mm_struct *mm, short d)
 {
        pr_warn("ref_ctr %s failed for inode: 0x%lx offset: "
-               "0x%llx ref_ctr_offset: 0x%llx of mm: 0x%pK\n",
+               "0x%llx ref_ctr_offset: 0x%llx of mm: 0x%p\n",
                d > 0 ? "increment" : "decrement", uprobe->inode->i_ino,
                (unsigned long long) uprobe->offset,
                (unsigned long long) uprobe->ref_ctr_offset, mm);