Skip to contentSkip to conversation

drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE

PATCH RESEND In review Nicolas Boichat 4 participants 4 messages Feb 17, 2016 – Feb 20, 2016 Android drivers

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE

From: Lisa Du <[email protected]>

There's one point was missed in the patch commit da49889deb34 ("staging:
binder: Support concurrent 32 bit and 64 bit processes."). When configure BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of void * is 64bit on 64bit system. Correct it here.

---

This patch was first sent upstream here: https://lkml.org/lkml/2015/5/28/747,
but was not picked up (probably because it was part of a bigger series that refactored binder).

This patch fixes issues when using 64-bit binder API on 32-bit kernels.

 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder.c +1 -1
index 796301a..16288e7 100644
@@ -2081,7 +2081,7 @@ static int binder_thread_write(struct binder_proc *proc,
 			if (get_user(cookie, (binder_uintptr_t __user *)ptr))
 				return -EFAULT;
 
-			ptr += sizeof(void *);
+			ptr += sizeof(cookie);
 			list_for_each_entry(w, &proc->delivered_death, entry) {
 				struct binder_ref_death *tmp_death = container_of(w, struct binder_ref_death, work);
 
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#1 lore raw
Quoted 3 lines · Nicolas Boichat

This patch was first sent upstream here: https://lkml.org/lkml/2015/5/28/747,
but was not picked up (probably because it was part of a bigger series that refactored binder).

Riley was supposed to resend it with a proper sign off but he must have lost track. Anyway, thanks for doing follow up on this.

regards,
dan carpenter

Acked-by on v1 1/1
#2 lore raw
In reply to Nicolas Boichat

Hi,

Quoted 9 lines · Nicolas Boichat

From: Lisa Du <[email protected]>

There's one point was missed in the patch commit da49889deb34 ("staging:
binder: Support concurrent 32 bit and 64 bit processes."). When configure BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of void * is 64bit on 64bit system. Correct it here.

Fixes da49889deb34 ("staging: binder: Support concurrent 32 bit and

64 bit processes.")

(Hopefully Greg's script adds all 3 tags when he applies the patch. :)

-Olof

#3 lore raw
Quoted 13 lines · Olof Johansson

Hi,

Quoted 9 lines · Nicolas Boichat

From: Lisa Du <[email protected]>

There's one point was missed in the patch commit da49889deb34 ("staging:
binder: Support concurrent 32 bit and 64 bit processes."). When configure BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of void * is 64bit on 64bit system. Correct it here.

Quoted 6 lines
Fixes da49889deb34 ("staging: binder: Support concurrent 32 bit and

64 bit processes.")

(Hopefully Greg's script adds all 3 tags when he applies the patch. :)

Now added, thanks.

greg k-h