Skip to content

Commit 4231694

Browse files
Carlos Llamasgregkh
authored andcommitted
binder: fix max_thread type inconsistency
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 <[email protected]> Cc: [email protected] Signed-off-by: Carlos Llamas <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 203b283 commit 4231694

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
@@ -5367,7 +5367,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
53675367
goto err;
53685368
break;
53695369
case BINDER_SET_MAX_THREADS: {
5370-
int max_threads;
5370+
u32 max_threads;
53715371

53725372
if (copy_from_user(&max_threads, ubuf,
53735373
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)