diff options
author | Todd Kjos <tkjos@android.com> | 2017-06-29 21:01:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-17 14:48:23 +0200 |
commit | 7a4408c6bd3eb1dafba67986259191be081e3efb (patch) | |
tree | b83320c5a5216a0d00b0880ebca7b50bd35529a0 /drivers/android/binder_trace.h | |
parent | binder: make sure target_node has strong ref (diff) | |
download | linux-7a4408c6bd3eb1dafba67986259191be081e3efb.tar.xz linux-7a4408c6bd3eb1dafba67986259191be081e3efb.zip |
binder: make sure accesses to proc/thread are safe
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.
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder_trace.h')
0 files changed, 0 insertions, 0 deletions