Commit 41380d81 authored by Todd Kjos's avatar Todd Kjos Committed by Kleber Sacilotto de Souza

binder: replace "%p" with "%pK"

BugLink: https://bugs.launchpad.net/bugs/1832661

commit 8ca86f16 upstream.

The format specifier "%p" can leak kernel addresses. Use
"%pK" instead. There were 4 remaining cases in binder.c.
Signed-off-by: default avatarTodd Kjos <tkjos@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 4.4: adjust context]
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent fe614582
...@@ -1249,7 +1249,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc, ...@@ -1249,7 +1249,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
int debug_id = buffer->debug_id; int debug_id = buffer->debug_id;
binder_debug(BINDER_DEBUG_TRANSACTION, binder_debug(BINDER_DEBUG_TRANSACTION,
"%d buffer release %d, size %zd-%zd, failed at %p\n", "%d buffer release %d, size %zd-%zd, failed at %pK\n",
proc->pid, buffer->debug_id, proc->pid, buffer->debug_id,
buffer->data_size, buffer->offsets_size, failed_at); buffer->data_size, buffer->offsets_size, failed_at);
...@@ -2105,7 +2105,7 @@ static int binder_thread_write(struct binder_proc *proc, ...@@ -2105,7 +2105,7 @@ static int binder_thread_write(struct binder_proc *proc,
} }
} }
binder_debug(BINDER_DEBUG_DEAD_BINDER, binder_debug(BINDER_DEBUG_DEAD_BINDER,
"%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n", "%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n",
proc->pid, thread->pid, (u64)cookie, proc->pid, thread->pid, (u64)cookie,
death); death);
if (death == NULL) { if (death == NULL) {
...@@ -3249,7 +3249,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix, ...@@ -3249,7 +3249,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix,
struct binder_transaction *t) struct binder_transaction *t)
{ {
seq_printf(m, seq_printf(m,
"%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d", "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d",
prefix, t->debug_id, t, prefix, t->debug_id, t,
t->from ? t->from->proc->pid : 0, t->from ? t->from->proc->pid : 0,
t->from ? t->from->pid : 0, t->from ? t->from->pid : 0,
...@@ -3263,7 +3263,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix, ...@@ -3263,7 +3263,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix,
if (t->buffer->target_node) if (t->buffer->target_node)
seq_printf(m, " node %d", seq_printf(m, " node %d",
t->buffer->target_node->debug_id); t->buffer->target_node->debug_id);
seq_printf(m, " size %zd:%zd data %p\n", seq_printf(m, " size %zd:%zd data %pK\n",
t->buffer->data_size, t->buffer->offsets_size, t->buffer->data_size, t->buffer->offsets_size,
t->buffer->data); t->buffer->data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment