mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] binder: fix offset calculation in debug log
@ 2025-03-25 18:49 Carlos Llamas
  2025-03-25 20:25 ` Tiffany Y. Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos Llamas @ 2025-03-25 18:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
	Suren Baghdasaryan, Alice Ryhl
  Cc: linux-kernel, kernel-team, Tiffany Y. Yang, stable

The vma start address should be substracted from the buffer's user data
address and not the other way around.

Cc: Tiffany Y. Yang <ynaffit@google.com>
Cc: stable@vger.kernel.org
Fixes: 162c79731448 ("binder: avoid user addresses in debug logs")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 76052006bd87..5fc2c8ee61b1 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -6373,7 +6373,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
 		seq_printf(m, " node %d", buffer->target_node->debug_id);
 	seq_printf(m, " size %zd:%zd offset %lx\n",
 		   buffer->data_size, buffer->offsets_size,
-		   proc->alloc.vm_start - buffer->user_data);
+		   buffer->user_data - proc->alloc.vm_start);
 }
 
 static void print_binder_work_ilocked(struct seq_file *m,
-- 
2.49.0.395.g12beb8f557-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] binder: fix offset calculation in debug log
  2025-03-25 18:49 [PATCH] binder: fix offset calculation in debug log Carlos Llamas
@ 2025-03-25 20:25 ` Tiffany Y. Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Tiffany Y. Yang @ 2025-03-25 20:25 UTC (permalink / raw)
  To: Carlos Llamas
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Suren Baghdasaryan, Alice Ryhl, linux-kernel, kernel-team,
	stable

Carlos Llamas <cmllamas@google.com> writes:

> The vma start address should be substracted from the buffer's user data
> address and not the other way around.
>
> Cc: Tiffany Y. Yang <ynaffit@google.com>
> Cc: stable@vger.kernel.org
> Fixes: 162c79731448 ("binder: avoid user addresses in debug logs")
> Signed-off-by: Carlos Llamas <cmllamas@google.com>

Reviewed-by: Tiffany Y. Yang <ynaffit@google.com>

> ---
>  drivers/android/binder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 76052006bd87..5fc2c8ee61b1 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -6373,7 +6373,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
>  		seq_printf(m, " node %d", buffer->target_node->debug_id);
>  	seq_printf(m, " size %zd:%zd offset %lx\n",
>  		   buffer->data_size, buffer->offsets_size,
> -		   proc->alloc.vm_start - buffer->user_data);
> +		   buffer->user_data - proc->alloc.vm_start);
>  }
>  
>  static void print_binder_work_ilocked(struct seq_file *m,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-25 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-25 18:49 [PATCH] binder: fix offset calculation in debug log Carlos Llamas
2025-03-25 20:25 ` Tiffany Y. Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®