linux/drivers/android
Todd Kjos d8d0eccc20 FROMLIST: binder: make sure accesses to proc/thread are safe
(from https://patchwork.kernel.org/patch/9817787/)

binder_thread and binder_proc may be accessed by other
threads when processing transaction. Therefore they
must be prevented from being freed while a transaction
is in progress that references them.

This is done by introducing a temporary reference
counter for threads and procs that indicates that the
object is in use and must not be freed. binder_thread_dec_tmpref()
and binder_proc_dec_tmpref() are used to decrement
the temporary reference.

It is safe to free a binder_thread if there
is no reference and it has been released
(indicated by thread->is_dead).

It is safe to free a binder_proc if it has no
remaining threads and no reference.

A spinlock is added to the binder_transaction
to safely access and set references for t->from
and for debug code to safely access t->to_thread
and t->to_proc.

Change-Id: I0a00a0294c3e93aea8b3f141c6f18e77ad244078
Signed-off-by: Todd Kjos <tkjos@google.com>
2017-08-11 19:31:04 +05:30
..
binder_alloc.c FROMLIST: binder: add more debug info when allocation fails. 2017-08-11 19:31:04 +05:30
binder_alloc.h FROMLIST: binder: protect against two threads freeing buffer 2017-08-11 19:31:04 +05:30
binder_trace.h FROMLIST: binder: separate out binder_alloc functions 2017-08-11 19:31:04 +05:30
binder.c FROMLIST: binder: make sure accesses to proc/thread are safe 2017-08-11 19:31:04 +05:30
Kconfig ANDROID: binder: add hwbinder,vndbinder to BINDER_DEVICES. 2017-04-10 13:28:07 +05:30
Makefile FROMLIST: binder: move binder_alloc to separate file 2017-08-11 19:31:04 +05:30