Skip to content

Commit

Permalink
binder: fix max_thread type inconsistency
Browse files Browse the repository at this point in the history
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 <[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]>
  • Loading branch information
Carlos Llamas authored and gregkh committed May 25, 2024
1 parent 7e6d6f2 commit ddbcd7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -5165,7 +5165,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto err;
break;
case BINDER_SET_MAX_THREADS: {
int max_threads;
u32 max_threads;

if (copy_from_user(&max_threads, ubuf,
sizeof(max_threads))) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/android/binder_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ struct binder_proc {
struct list_head todo;
struct binder_stats stats;
struct list_head delivered_death;
int max_threads;
u32 max_threads;
int requested_threads;
int requested_threads_started;
int tmp_ref;
Expand Down

0 comments on commit ddbcd7d

Please sign in to comment.