mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] uprobes: Don't use %pK through printk
@ 2025-02-17  7:43 Thomas Weißschuh
  2025-02-18  8:53 ` [tip: perf/urgent] " tip-bot2 for Thomas Weißschuh
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2025-02-17  7:43 UTC (permalink / raw)
  To: Masami Hiramatsu, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter
  Cc: linux-kernel, linux-trace-kernel, linux-perf-users,
	Thomas Weißschuh

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.

Link: https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 kernel/events/uprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 2ca797cbe465f2d4a596e4a5d0d2d5a45e5cacf9..bf2a87a0a37878e99d0cf715ddedfdc2d1949c5d 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -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);

---
base-commit: 0ad2507d5d93f39619fc42372c347d6006b64319
change-id: 20250217-restricted-pointers-uprobes-830c16917cf5

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: perf/urgent] uprobes: Don't use %pK through printk
  2025-02-17  7:43 [PATCH] uprobes: Don't use %pK through printk Thomas Weißschuh
@ 2025-02-18  8:53 ` tip-bot2 for Thomas Weißschuh
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2025-02-18  8:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: thomas.weissschuh, Ingo Molnar, Masami Hiramatsu, Oleg Nesterov,
	Peter Zijlstra, x86, linux-kernel

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     ec5fd50aeff9c9156304853c6d75eda852d4a2c8
Gitweb:        https://git.kernel.org/tip/ec5fd50aeff9c9156304853c6d75eda852d4a2c8
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Mon, 17 Feb 2025 08:43:35 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 18 Feb 2025 09:48:02 +01:00

uprobes: Don't use %pK through printk

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 2ca797c..bf2a87a 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-18  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-17  7:43 [PATCH] uprobes: Don't use %pK through printk Thomas Weißschuh
2025-02-18  8:53 ` [tip: perf/urgent] " tip-bot2 for Thomas Weißschuh

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

all inboxes | Powered by JetHome®