android_kernel_motorola_sm6375/drivers/android
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Todd Kjos 48fc8eebd1 binder: fix handling of error during copy
[ Upstream commit fe6b1869243f23a485a106c214bcfdc7aa0ed593 ]

If a memory copy function fails to copy the whole buffer,
a positive integar with the remaining bytes is returned.
In binder_translate_fd_array() this can result in an fd being
skipped due to the failed copy, but the loop continues
processing fds since the early return condition expects a
negative integer on error.

Fix by returning "ret > 0 ? -EINVAL : ret" to handle this case.

Fixes: bb4a2e48d5 ("binder: return errors from buffer copy functions")
Suggested-by: Dan Carpenter <[email protected]>
Acked-by: Christian Brauner <[email protected]>
Signed-off-by: Todd Kjos <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2022-01-27 09:19:38 +01:00
..
binder.c binder: fix handling of error during copy 2022-01-27 09:19:38 +01:00
binder_alloc.c binder: fix async_free_space accounting for empty parcels 2022-01-05 12:37:46 +01:00
binder_alloc.h
binder_alloc_selftest.c
binder_internal.h
binder_trace.h
binderfs.c
Kconfig
Makefile