linux-stable/drivers/android
Carlos Llamas a7ae586f6f 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 09:25:04 +01:00
..
Kconfig remove CONFIG_ANDROID 2022-07-01 10:41:09 +02:00
Makefile
binder.c binder: signal epoll threads of self-work 2024-02-23 09:25:04 +01:00
binder_alloc.c binder: fix race between mmput() and do_exit() 2024-01-25 15:35:42 -08:00
binder_alloc.h binder: fix memory leak in binder_init() 2023-08-04 15:25:01 +02:00
binder_alloc_selftest.c Revert "android: binder: stop saving a pointer to the VMA" 2023-05-13 20:30:16 +09:00
binder_internal.h Binder: Add async from to transaction record 2023-05-13 20:38:12 +09:00
binder_trace.h Binder: add TF_UPDATE_TXN to replace outdated txn 2022-06-27 16:16:30 +02:00
binderfs.c Char/Misc driver changes for 6.6-rc1 2023-09-01 09:53:54 -07:00