Commit b427bc70 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

ANDROID: rust_binder: add BINDER_TYPE_FD support

Add support for sending fds over binder.

Unlike the other object types, file descriptors are not translated until
the transaction is actually received by the recipient. Until that
happens, we store `u32::MAX` as the fd.

Translating fds is done in a two-phase process. First, the file
descriptors are allocated and written to the allocation. Then, once we
have allocated all of them, we commit them to the files in question.
Using this strategy, we are able to guarantee that we either send all of
the fds, or none of them.

Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-13-08ba9197f637@google.com/


Change-Id: Ia57fa9f732b7363c4a75fe49a48baef6ebfa8de2
Co-developed-by: default avatarWedson Almeida Filho <wedsonaf@gmail.com>
Signed-off-by: default avatarWedson Almeida Filho <wedsonaf@gmail.com>
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
Bug: 278052745
parent 451e930f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment