1 | Identify buffer addresses using vma offsets instead of full user | 1 | Identify buffer addresses using vma offsets instead of full user |
---|---|---|---|
2 | addresses in debug logs or drop them if they are not useful. | 2 | addresses in debug logs or drop them if they are not useful. |
3 | 3 | ||
4 | Signed-off-by: Tiffany Y. Yang <ynaffit@google.com> | 4 | Signed-off-by: Tiffany Y. Yang <ynaffit@google.com> |
5 | --- | 5 | --- |
6 | |||
7 | V3 -> V4: Replace alloc.buffer with alloc.vm_start | ||
6 | V2 -> V3: Drop transaction data addresses | 8 | V2 -> V3: Drop transaction data addresses |
7 | V1 -> V2: Resend to mailing lists | 9 | V1 -> V2: Resend to mailing lists |
8 | 10 | ||
9 | drivers/android/binder.c | 27 +++++++++++---------------- | 11 | drivers/android/binder.c | 27 +++++++++++---------------- |
10 | 1 file changed, 11 insertions(+), 16 deletions(-) | 12 | 1 file changed, 11 insertions(+), 16 deletions(-) |
... | ... | ||
42 | binder_user_error( | 44 | binder_user_error( |
43 | - "%d:%d BC_FREE_BUFFER u%016llx matched unreturned or currently freeing buffer\n", | 45 | - "%d:%d BC_FREE_BUFFER u%016llx matched unreturned or currently freeing buffer\n", |
44 | + "%d:%d BC_FREE_BUFFER matched unreturned or currently freeing buffer at offset %lx\n", | 46 | + "%d:%d BC_FREE_BUFFER matched unreturned or currently freeing buffer at offset %lx\n", |
45 | proc->pid, thread->pid, | 47 | proc->pid, thread->pid, |
46 | - (u64)data_ptr); | 48 | - (u64)data_ptr); |
47 | + (unsigned long)data_ptr - proc->alloc.buffer); | 49 | + (unsigned long)data_ptr - proc->alloc.vm_start); |
48 | } else { | 50 | } else { |
49 | binder_user_error( | 51 | binder_user_error( |
50 | - "%d:%d BC_FREE_BUFFER u%016llx no match\n", | 52 | - "%d:%d BC_FREE_BUFFER u%016llx no match\n", |
51 | + "%d:%d BC_FREE_BUFFER no match for buffer at offset %lx\n", | 53 | + "%d:%d BC_FREE_BUFFER no match for buffer at offset %lx\n", |
52 | proc->pid, thread->pid, | 54 | proc->pid, thread->pid, |
53 | - (u64)data_ptr); | 55 | - (u64)data_ptr); |
54 | + (unsigned long)data_ptr - proc->alloc.buffer); | 56 | + (unsigned long)data_ptr - proc->alloc.vm_start); |
55 | } | 57 | } |
56 | break; | 58 | break; |
57 | } | 59 | } |
58 | binder_debug(BINDER_DEBUG_FREE_BUFFER, | 60 | binder_debug(BINDER_DEBUG_FREE_BUFFER, |
59 | - "%d:%d BC_FREE_BUFFER u%016llx found buffer %d for %s transaction\n", | 61 | - "%d:%d BC_FREE_BUFFER u%016llx found buffer %d for %s transaction\n", |
60 | - proc->pid, thread->pid, (u64)data_ptr, | 62 | - proc->pid, thread->pid, (u64)data_ptr, |
61 | + "%d:%d BC_FREE_BUFFER at offset %lx found buffer %d for %s transaction\n", | 63 | + "%d:%d BC_FREE_BUFFER at offset %lx found buffer %d for %s transaction\n", |
62 | + proc->pid, thread->pid, | 64 | + proc->pid, thread->pid, |
63 | + (unsigned long)data_ptr - proc->alloc.buffer, | 65 | + (unsigned long)data_ptr - proc->alloc.vm_start, |
64 | buffer->debug_id, | 66 | buffer->debug_id, |
65 | buffer->transaction ? "active" : "finished"); | 67 | buffer->transaction ? "active" : "finished"); |
66 | binder_free_buf(proc, thread, buffer, false); | 68 | binder_free_buf(proc, thread, buffer, false); |
67 | @@ -XXX,XX +XXX,XX @@ static int binder_thread_read(struct binder_proc *proc, | 69 | @@ -XXX,XX +XXX,XX @@ static int binder_thread_read(struct binder_proc *proc, |
68 | trace_binder_transaction_received(t); | 70 | trace_binder_transaction_received(t); |
... | ... | ||
82 | + t->buffer->data_size, t->buffer->offsets_size); | 84 | + t->buffer->data_size, t->buffer->offsets_size); |
83 | 85 | ||
84 | if (t_from) | 86 | if (t_from) |
85 | binder_thread_dec_tmpref(t_from); | 87 | binder_thread_dec_tmpref(t_from); |
86 | -- | 88 | -- |
87 | 2.49.0.472.ge94155a9ec-goog | 89 | 2.49.0.504.g3bcea36a83-goog | diff view generated by jsdifflib |