Files
linux/drivers
Todd Kjos fe6b186924 binder: fix handling of error during copy
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 <dan.carpenter@oracle.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20211130185152.437403-2-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-03 14:29:39 +01:00
..
2021-11-26 19:45:31 +01:00
2021-11-23 10:55:48 +01:00
2021-11-26 22:54:47 +01:00
2021-12-03 14:26:33 +01:00
2021-11-23 12:32:28 +01:00
2021-11-16 14:41:23 +01:00
2021-11-18 20:40:28 +01:00