linux-stable/drivers/android
Carlos Llamas dd64bb8329 binder: signal epoll threads of self-work
commit 97830f3c30 upstream.

In (e)poll mode, threads often depend on I/O events to determine when
data is ready for consumption. Within binder, a thread may initiate a
command via BINDER_WRITE_READ without a read buffer and then make use
of epoll_wait() or similar to consume any responses afterwards.

It is then crucial that epoll threads are signaled via wakeup when they
queue their own work. Otherwise, they risk waiting indefinitely for an
event leaving their work unhandled. What is worse, subsequent commands
won't trigger a wakeup either as the thread has pending work.

Fixes: 457b9a6f09 ("Staging: android: add binder driver")
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Martijn Coenen <maco@android.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Steven Moreland <smoreland@google.com>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20240131215347.1808751-1-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 08:12:57 +01:00
..
Kconfig android: binder: Drop dependency on !M68K 2018-07-07 17:44:52 +02:00
Makefile android: binder: Add allocator selftest 2017-08-28 16:47:17 +02:00
binder.c binder: signal epoll threads of self-work 2024-02-23 08:12:57 +01:00
binder_alloc.c binder: fix unused alloc->free_async_space 2024-01-25 14:33:37 -08:00
binder_alloc.h binder: fix memory leak in binder_init() 2023-08-16 18:13:00 +02:00
binder_alloc_selftest.c android: binder: Add global lru shrinker to binder 2017-08-28 16:47:17 +02:00
binder_trace.h android: binder: Show extra_buffers_size in trace 2018-08-02 10:34:12 +02:00