Skip to content

Commit 71df2cb

Browse files
Carlos Llamasgregkh
authored andcommitted
binder: fix max_thread type inconsistency
commit 4231694 upstream. The type defined for the BINDER_SET_MAX_THREADS ioctl was changed from size_t to __u32 in order to avoid incompatibility issues between 32 and 64-bit kernels. However, the internal types used to copy from user and store the value were never updated. Use u32 to fix the inconsistency. Fixes: a9350fc ("staging: android: binder: fix BINDER_SET_MAX_THREADS declaration") Reported-by: Arve Hjønnevåg <arve@android.com> Cc: stable@vger.kernel.org Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240421173750.3117808-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c364e7a commit 71df2cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/android/binder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5368,7 +5368,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
53685368
goto err;
53695369
break;
53705370
case BINDER_SET_MAX_THREADS: {
5371-
int max_threads;
5371+
u32 max_threads;
53725372

53735373
if (copy_from_user(&max_threads, ubuf,
53745374
sizeof(max_threads))) {

drivers/android/binder_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ struct binder_proc {
421421
struct list_head todo;
422422
struct binder_stats stats;
423423
struct list_head delivered_death;
424-
int max_threads;
424+
u32 max_threads;
425425
int requested_threads;
426426
int requested_threads_started;
427427
int tmp_ref;

0 commit comments

Comments
 (0)