public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] binder: fix memory corruption in binder_transaction binder
@ 2017-09-05 17:21 Todd Kjos
  2017-09-11 12:18 ` Amit Pundir
  0 siblings, 1 reply; 8+ messages in thread
From: Todd Kjos @ 2017-09-05 17:21 UTC (permalink / raw)
  To: gregkh, arve, devel, linux-kernel, maco, tkjos, xuyiping,
	gengyanping, shiwanglai

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

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

end of thread, other threads:[~2017-10-03  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-05 17:21 [PATCH] binder: fix memory corruption in binder_transaction binder Todd Kjos
2017-09-11 12:18 ` Amit Pundir
     [not found]   ` <CAHRSSEwVSHSoYJc8JEaAkNwG+v5Fgaq4sO7GZ7otHzyv9m+qFg@mail.gmail.com>
2017-09-11 15:40     ` Todd Kjos
2017-09-11 16:55       ` Amit Pundir
2017-09-11 17:24         ` Greg Kroah-Hartman
2017-09-11 19:59         ` Todd Kjos
2017-09-12  8:20           ` Martijn Coenen
2017-10-03  8:45             ` Amit Pundir

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