Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726890

[PATCH] binder: fix memory corruption in binder_transaction binder

From Todd Kjos <tkjos@android.com>
Newsgroups linux.kernel
Subject [PATCH] binder: fix memory corruption in binder_transaction binder
Date 2017-09-05 19:30 +0200
Message-ID <umpPH-5JK-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Xu YiPing <xuyiping@hisilicon.com>

commit 7a4408c6bd3e ("binder: make sure accesses to proc/thread are
safe") made a change to enqueue tcomplete to thread->todo before
enqueuing the transaction. However, in err_dead_proc_or_thread case,
the tcomplete is directly freed, without dequeued. It may cause the
thread->todo list to be corrupted.

So, dequeue it before freeing.

Signed-off-by: Xu YiPing <xuyiping@hisilicon.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
---
 drivers/android/binder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index d055b3f2a207..96cc28afa383 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3083,6 +3083,7 @@ static void binder_transaction(struct binder_proc *proc,
 err_dead_proc_or_thread:
 	return_error = BR_DEAD_REPLY;
 	return_error_line = __LINE__;
+	binder_dequeue_work(proc, tcomplete);
 err_translate_failed:
 err_bad_object_type:
 err_bad_offset:
-- 
2.14.1.581.gf28d330327-goog

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] binder: fix memory corruption in binder_transaction binder Todd Kjos <tkjos@android.com> - 2017-09-05 19:30 +0200

csiph-web