]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/android/binder.c
binder: use inner lock to sync work dq and node counts
authorTodd Kjos <tkjos@android.com>
Thu, 29 Jun 2017 19:02:01 +0000 (12:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jul 2017 12:48:23 +0000 (14:48 +0200)
commited29721e22e30939f417a2f734c0bfb3a980647d
treeba3387eaf4a95474fb7986c67937b5e668b6c2f1
parent9630fe8839baf3f47df9187ca720cfa1c10b132e
binder: use inner lock to sync work dq and node counts

For correct behavior we need to hold the inner lock when
dequeuing and processing node work in binder_thread_read.
We now hold the inner lock when we enter the switch statement
and release it after processing anything that might be
affected by other threads.

We also need to hold the inner lock to protect the node
weak/strong ref tracking fields as long as node->proc
is non-NULL (if it is NULL then we are guaranteed that
we don't have any node work queued).

This means that other functions that manipulate these fields
must hold the inner lock. Refactored these functions to use
the inner lock.

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