Re: [PATCH v3] binder: use buffer offsets in debug logs

From: Carlos Llamas
Date: Mon Mar 31 2025 - 22:19:01 EST


On Thu, Mar 27, 2025 at 11:17:09PM +0000, Tiffany Y. Yang wrote:
> Identify buffer addresses using vma offsets instead of full user
> addresses in debug logs or drop them if they are not useful.
>
> Signed-off-by: Tiffany Y. Yang <ynaffit@xxxxxxxxxx>
> ---

This looks good but there is one problem...

> @@ -4223,20 +4219,21 @@ static int binder_thread_write(struct binder_proc *proc,
> if (IS_ERR_OR_NULL(buffer)) {
> if (PTR_ERR(buffer) == -EPERM) {
> binder_user_error(
> - "%d:%d BC_FREE_BUFFER u%016llx matched unreturned or currently freeing buffer\n",
> + "%d:%d BC_FREE_BUFFER matched unreturned or currently freeing buffer at offset %lx\n",
> proc->pid, thread->pid,
> - (u64)data_ptr);
> + (unsigned long)data_ptr - proc->alloc.buffer);

The alloc.buffer should be alloc.vm_start, this was recently renamed. I
think you would need to rebase your tree.

--
Carlos Llamas