anolis-cloud-kernel/drivers/android
shaomingyin 3660675295 binder: signal epoll threads of self-work
ANBZ: #20707

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")
Fixes: CVE-2024-26606
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>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/5171
2025-05-15 02:11:18 +00:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
binder.c binder: signal epoll threads of self-work 2025-05-15 02:11:18 +00:00
binder_alloc.c binder: fix use-after-free in shinker's callback 2024-03-06 13:59:30 +00:00
binder_alloc.h android: binder: stop saving a pointer to the VMA 2023-06-27 03:39:03 +00:00
binder_alloc_selftest.c android: binder: stop saving a pointer to the VMA 2023-06-27 03:39:03 +00:00
binder_internal.h binder: prevent UAF for binderfs devices II 2020-03-03 19:58:37 +01:00
binder_trace.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
binderfs.c binderfs: make symbol 'binderfs_fs_parameters' static 2020-09-03 18:24:39 +02:00