]> git.baikalelectronics.ru Git - kernel.git/commit
binder: read pre-translated fds from sender buffer
authorTodd Kjos <tkjos@google.com>
Wed, 30 Nov 2022 03:58:01 +0000 (03:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:01 +0000 (11:23 +0100)
commitdb72da6e502b6e2745261e3f957e820315748ebd
tree8f277a0d0ae2583a2101a59d9f82378a5c5278e0
parent8ec2961a0966cfa3aef79561ca861d879f1001aa
binder: read pre-translated fds from sender buffer

commit 6b853036d668dc2dd6dd82fae5f683763de66312 upstream.

This patch is to prepare for an up coming patch where we read
pre-translated fds from the sender buffer and translate them before
copying them to the target.  It does not change run time.

The patch adds two new parameters to binder_translate_fd_array() to
hold the sender buffer and sender buffer parent.  These parameters let
us call copy_from_user() directly from the sender instead of using
binder_alloc_copy_from_buffer() to copy from the target.  Also the patch
adds some new alignment checks.  Previously the alignment checks would
have been done in a different place, but this lets us print more
useful error messages.

Reviewed-by: Martijn Coenen <maco@android.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-4-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c