Skip to contentSkip to conversation

FAILED: patch "[PATCH] binder: fix offset calculation in debug log" failed to apply to 6.12-stable tree

PATCH In review [email protected] 3 participants 3 messages Apr 28, 2025 – May 1, 2025

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 170d1a3738908eef6a0dbf378ea77fb4ae8e294d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025042803-deflected-overdue-01a5@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 170d1a3738908eef6a0dbf378ea77fb4ae8e294d Mon Sep 17 00:00:00 2001
From: Carlos Llamas <[email protected]>
Date: Tue, 25 Mar 2025 18:49:00 +0000
Subject: [PATCH] binder: fix offset calculation in debug log

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

Cc Tiffany Y. Yang <[email protected]>
Cc stable <[email protected]>
Fixes 162c79731448 ("binder: avoid user addresses in debug logs")
drivers/android/binder.c +1 -1
index 76052006bd87..5fc2c8ee61b1 100644
@@ -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,
maintainer
#1 lore raw

PATCH 1/1 binder: fix offset calculation in debug log

commit 170d1a3738908eef6a0dbf378ea77fb4ae8e294d upstream.

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

Cc Tiffany Y. Yang <[email protected]>
Cc stable <[email protected]>
Fixes 162c79731448 ("binder: avoid user addresses in debug logs")
[cmllamas: fix conflicts due to alloc->buffer renaming]
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder.c +1 -1
index ef353ca13c35..bdf09e8b898d 100644
@@ -6374,7 +6374,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.buffer - buffer->user_data);
+		   buffer->user_data - proc->alloc.buffer);
 }
 
 static void print_binder_work_ilocked(struct seq_file *m,
Signature · 1 line
2.49.0.901.g37484f566f-goog
maintainer Reviewed-by Tiffany Y. Yang on v1 1/1
#2 lore raw

Re: [PATCH 6.12.y] binder: fix offset calculation in debug log

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: 170d1a3738908eef6a0dbf378ea77fb4ae8e294d

Status in newer kernel trees:
6.14.y | Present (different SHA1: c8f9ccac8a5b)

Note: The patch differs from the upstream commit:
---
1: 170d1a3738908 ! 1: 1eec0d8c91a39 binder: fix offset calculation in debug log
@@ Metadata
## Commit message ##
binder: fix offset calculation in debug log

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

@@ Commit message

+ [cmllamas: fix conflicts due to alloc->buffer renaming]
+ Signed-off-by: Carlos Llamas <[email protected]>

## drivers/android/binder.c ##
@@ drivers/android/binder.c: 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);
+- proc->alloc.buffer - buffer->user_data);
++ buffer->user_data - proc->alloc.buffer);
}

static void print_binder_work_ilocked(struct seq_file *m,
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y       |  Success    |  Success   |