binder: don't modify thread->looper from other threads
authorTodd Kjos <tkjos@android.com>
Thu, 29 Jun 2017 19:01:49 +0000 (12:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jul 2017 12:47:29 +0000 (14:47 +0200)
commit08dabceefee0eddace493fc16da172c93402187f
tree2adeda656687f13b4238936377b6328a8444b4ee
parentccae6f676001d00efd1a4626773d1577e53188f7
binder: don't modify thread->looper from other threads

The looper member of struct binder_thread is a bitmask
of control bits. All of the existing bits are modified
by the affected thread except for BINDER_LOOPER_STATE_NEED_RETURN
which can be modified in binder_deferred_flush() by
another thread.

To avoid adding a spinlock around all read-mod-writes to
modify a bit, the BINDER_LOOPER_STATE_NEED_RETURN flag
is replaced by a separate field in struct binder_thread.

Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c