[PATCH] binder: Use %p for pointer formatting

Sebastian Andrzej Siewior <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
Commit 8ca86f1639ec5 ("binder: replace "%p" with "%pK"") introduced the
%pK modifier in order not to leak kernel pointer.
Since commit ad67b74d2469d ("printk: hash addresses printed with %p")
pointers are hashed by default and the behaviour can be controller by
`hash_pointers' boot argument.
Commit 57483a362741e ("binder: Create safe versions of binder log
files") introduced a hashed version while preserving the other interface
where pointers are returned. This interface is for debugging of memory
leaks. Ideally it would provide just one interface without leaking
pointers.

The policy on %p is to not introduce new ones. Rather then removing the
pointer output make it use %p.

Cc: Tiffany Y. Yang <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 8f2ef1bd539f1..0a42d2957772d 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -6413,7 +6413,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
 	spin_lock(&t->lock);
 	to_proc = t->to_proc;
 	seq_printf(m,
-		   "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld a%d r%d elapsed %lldms",
+		   "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld a%d r%d elapsed %lldms",
 		   prefix, t->debug_id, t,
 		   t->from_pid,
 		   t->from_tid,
@@ -6578,7 +6578,7 @@ static void print_binder_ref_olocked(struct seq_file *m,
 				     struct binder_ref *ref)
 {
 	binder_node_lock(ref->node);
-	seq_printf(m, "  ref %d: desc %d %snode %d s %d w %d d %pK\n",
+	seq_printf(m, "  ref %d: desc %d %snode %d s %d w %d d %p\n",
 		   ref->data.debug_id, ref->data.desc,
 		   ref->node->proc ? "" : "dead ",
 		   ref->node->debug_id, ref->data.strong,
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.