Skip to content

Commit 8ca86f1

Browse files
Todd Kjosgregkh
authored andcommitted
binder: replace "%p" with "%pK"
The format specifier "%p" can leak kernel addresses. Use "%pK" instead. There were 4 remaining cases in binder.c. Signed-off-by: Todd Kjos <tkjos@google.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e46a3b3 commit 8ca86f1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/android/binder.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
21992199
int debug_id = buffer->debug_id;
22002200

22012201
binder_debug(BINDER_DEBUG_TRANSACTION,
2202-
"%d buffer release %d, size %zd-%zd, failed at %p\n",
2202+
"%d buffer release %d, size %zd-%zd, failed at %pK\n",
22032203
proc->pid, buffer->debug_id,
22042204
buffer->data_size, buffer->offsets_size, failed_at);
22052205

@@ -3711,7 +3711,7 @@ static int binder_thread_write(struct binder_proc *proc,
37113711
}
37123712
}
37133713
binder_debug(BINDER_DEBUG_DEAD_BINDER,
3714-
"%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n",
3714+
"%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n",
37153715
proc->pid, thread->pid, (u64)cookie,
37163716
death);
37173717
if (death == NULL) {
@@ -5042,7 +5042,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
50425042
spin_lock(&t->lock);
50435043
to_proc = t->to_proc;
50445044
seq_printf(m,
5045-
"%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d",
5045+
"%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d",
50465046
prefix, t->debug_id, t,
50475047
t->from ? t->from->proc->pid : 0,
50485048
t->from ? t->from->pid : 0,
@@ -5066,7 +5066,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
50665066
}
50675067
if (buffer->target_node)
50685068
seq_printf(m, " node %d", buffer->target_node->debug_id);
5069-
seq_printf(m, " size %zd:%zd data %p\n",
5069+
seq_printf(m, " size %zd:%zd data %pK\n",
50705070
buffer->data_size, buffer->offsets_size,
50715071
buffer->data);
50725072
}

0 commit comments

Comments
 (0)