| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Test: mma
Bug: 302723053
Change-Id: I52f14cadb027b3f854946d5315dce3d23aa21b19
|
| |
|
|
|
|
| |
Test: mma
Bug: 302723053
Change-Id: I744bdfe735624ad9f95a7d448919e7bd2e430098
|
| |
|
|
|
|
|
|
| |
25c1a3b8543dd1756308424dd65030f90bb7a99f
Test: m
Bug: 302723053
Change-Id: Id9355c10d78d0c55afb49f512b78bb0923fbc4f7
|
| |
|
|
|
|
| |
Test: mma
Bug: 302723053
Change-Id: Iea797d6af825d58543ba899f6e712b27e48d859a
|
| |
|
|
|
|
| |
Bug: 302723053
Test: mma
Change-Id: Id68a10a491e3db7f27ea2cbf843078544bb0ab85
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Revert submission 2780893
Reason for revert: breaking boot tests
Bug: 308214260
Reverted changes: /q/submissionid:2780893
Change-Id: I7a4ee9a45583a8a1d4a33447de55c63e6ce9d42a
|
| |
|
|
|
|
| |
Bug: 302723053
Test: mma
Change-Id: I27226885b8b5e771d675ba2d83d0a2e14551d13e
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
System by default cache TCP data trying to pack more data before sending
out to the wire, this cause delay in rpc communication.
Currently we set TCP_NDELAY in RpcSession, but not in RpcServer.
This CL add TCP_NDELAY to RpcServer also.
Bug: 304823925
Test: manual
Change-Id: I8bfda370a78eff9b8e0ab75e6bc2fd0a5ba743ed
|
| |\ \
| | |
| | |
| | | |
into main
|
| | |/
| |
| |
| |
| |
| |
| | |
Bug: 302723053
Test: mma in binder folder
Test: aosp/2616196
Change-Id: I73df8fc453df0edf496960853cb0004f1c3a6a43
|
| |/
|
|
|
|
| |
Bug: 302723053
Test: mma
Change-Id: I5c7a71a91b7dc95bfa0cd653eabe554bdd3f7812
|
| |
|
|
|
|
| |
Bug: 274156888
Test: N/A
Change-Id: Iad721ebea7ddd461ed41f2ba1fc08849309f7611
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Return an error if you set an invalid protocol
version on an RpcServer.
Previously, this would cause errors later down
the line.
Bug: 278946301
Test: binderRpcTest
Change-Id: Id496f1d39b2a32ce775e585f7690ae59503dc3aa
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The member ai_addr is allowed to be null, which will cause dereferencing nullptr
issue here.
See https://android-build.corp.google.com/artifact/pending/P54712024/aosp_arm64-userdebug/latest/view/logs%2Fbuild.log
for more details
Bug: None
Test: mm
Change-Id: Ie1e8ec56bbd1edee0456c26d0d29775bc7abbbb5
|
| |/
|
|
|
|
|
| |
Bug: 274786956
Test: atest libsdvrpc_test_cpp
Change-Id: I58b0b99b5e3ab8c9659eed0eba9ff689000b84ac
|
| |
|
|
|
|
| |
Bug: 268131636
Test: binderRpcTest
Change-Id: I3466a6fa068e400843bc006a370da7f53771f95c
|
| |
|
|
|
|
|
|
| |
If the service tries to shutdown before join(), we end up in this case.
Test: none
Bug: none
Change-Id: I0d2f59b0d398ce3a18b522d7830417220b1a5145
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
FdTrigger::triggerablePoll returns OK on POLLIN (higher priority)
and DEAD_OBJECT on POLLHUP (lower priority). Unlike INET or vsock,
socketpair() sockets trigger POLLIN|POLLHUP on EOF and EOF is detected
by recvmsg() returning zero bytes.
Adjust the server accept loop to take this into account and correctly
break out of the loop.
Bug: 250685929
Test: cleanly shut down UDS bootstrap RpcServer
Change-Id: I56d6a67373f16b5b1bdc167de94a7252bedca8e2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RpcServer::~RpcServer invokes shutdown() to trigger exit from all
join and session threads. The function waits for the number of
connections to drop down to zero, but this depends on RpcSession
promoting a wp<RpcServer> to sp<RpcServer>. Since this is happening
during the destructor, when the refcount is zero, this pointer
promotion fails. As a result, the list of connections may not be fully
cleared and the thread calling shutdown() will deadlock.
Fix this by forcing users to call shutdown() earlier and panicing
otherwise.
Bug: 263168076
Test: cleanly shutdown RpcServer with many connections
Change-Id: Ia67a4a839419aafb1bd47fb93ed2e76d56b107c2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently RpcServer only allows to start a server listening for
connections from VMHOST_CID_ANY. This is not always desirable as clients
may want to listen only for connections from specific CIDs, eg. only the
host or only local.
This can be partially solved by setting the bind CID of the virtual
socket. The server can bind to VMADDR_CID_LOCAL for local interface
only. VMADDR_CID_ANY same as its own CID will bind to the remote
interface and accept connections from all clients.
To this end, add a callback for filtering accepted connections in
RpcServer. This may already be possible with per-session root object.
However, the root object is selected very late, after initial
negotiation with the client. For both performance and safety, add the
callback immediately after accept() to reject the connection as early as
possible.
Bug: 245727626
Test: atest binderRpcTest
Change-Id: I5b3e6fd5119c77ef8c5c4fbbfead9892c5de1a07
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
Test: atest binderRpcTest
Bug: 222479468
Change-Id: Ie4d4cfe6ff85e91c2218eef76bd46b7b1f8d1167
|
| |/
|
|
|
|
| |
Test: atest binderRpcTest
Bug: 222479468
Change-Id: I4cf89f1543898279fe041f89f272eddccf29e763
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This cl adjusts the return in RpcServer::setupRawSocketServer()
when the socket_fd is not set up. Prior to this cl, errno is
returned. This can be confusing as errno is not always set up in
this case. The current CL fixed this and logged more clear
information.
Test: atest binderRpcTest
Bug: 222479468
Change-Id: Ic9718cbf3cf08befe4044e7f5f021b915b4c4c41
|
| |
|
|
|
|
|
|
|
|
|
| |
This implements an RPC binder over init-managed Unix domain sockets.
The cl adds binder tests and the new API is also used for
vm_payload_service inside Microdroid.
A previous cl aosp/2229557 sets up the binder over anonymous Unix sockets.
Test: atest MicrodroidTests ComposHostTestCases
Bug: 222479468
Change-Id: I0c7c38f4792c4536f5f88eb7e035091505f782f7
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for running RpcBinder over unnamed Unix domain sockets
created by socketpair(). This is useful e.g. between parent/child
processes.
The implementation uses the initial socket pair only to create more
socket pairs for individual connections. This creates a natural mapping
to syscalls used on sockets bound to an address:
socket() socketpair()
bind() n/a (preconnected)
connect() sendmsg()
listen() recvmsg()
Bug: 250685929
Test: atest binderRpcTest
Change-Id: Id4ff3946ddcfefe3592eb1149c61582f7369aa29
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Introducing new APIs in RpcServer and RpcSession to check
polling state of file descriptor. Removing fixed wait time
in binder_rpc_fuzzer.
Test: m binder_rpc_fuzzer &&
$ANDROID_HOST_OUT/fuzz/x86_64/binder_rpc_fuzzer/binder_rpc_fuzzer
Bug: 218518615
Change-Id: Ied82cd9c16514761a489731488924274a17053a6
|
| |
|
|
|
|
|
| |
Test: m
Test: m libbinder binderRpcTest
Bug: 218518615
Change-Id: I822bdb751f68c83e1b10c5fd16c9d8439646b771
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adding a new struct TransportFd which will contain unique_fd and
polling state of file descriptor. This will be useful in detecting
if all the descriptors are being polled. unique_fd and borrowed_fd
are replaced in these changes.
Test: m
Test: m libbinder binderRpcTest && atest binderRpcTest
Test: trusty/vendor/google/aosp/scripts/build.py --test
"boot-test:com.android.trusty.binder.test" qemu-generic-arm64-test-debug
Bug: 218518615
Change-Id: Id108806b98184582e5d93186b3b1884017c441ea
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
Add a new OS-specific function that creates a new
instance of the default RpcTransportCtxFactory.
This is needed because Android and Trusty have
different default transports: RpcTransportRaw and
RpcTransportTipcTrusty, respectively.
Bug: 230135749
Test: presubmit
Change-Id: I4abd443fe9a08c1fa0cc41dfca7ef1cdb69fe0fb
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a new trusty/ subdirectory containing all the files
needed to build Binder RPC on Trusty, including:
* A RpcServerTrusty class used to create Trusty Binder services
* The underlying RpcTransportTipcTrusty transport that interfaces
between libbinder and TIPC
* Trusty implementations of some OS-specific functionality, like logging
* Make-based build file for libbinder in the Trusty build system
Bug: 224644083
Test: build Trusty
Change-Id: I25b97736d41489d20c2dd266e8e110764215378c
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
Bug: 237639446
Test: atest binderRpcTest
Change-Id: Ic35a75fe2b218ef024c6e5e33901813a454243d6
|
| |/
|
|
|
|
|
|
|
|
|
| |
Separate the OS-specific functions setNonBlocking and
getRandomBytes from Utils.cpp into a separate OS-specific
OS.cpp file that other operating systems can override at
build time.
Bug: 224644083
Test: build Trusty
Change-Id: I2703fb81d4370b5f6264556ae57fdddb0573971a
|
| |
|
|
|
|
|
|
|
|
| |
Trusty does not support threading. This adds a build option
to disable mutexes and other threading code from RpcState,
RpcSession, and RpcServer.
Bug: 224644083
Test: build Trusty
Change-Id: Iaa78caca1ddee45be7c2def2755598decc0d4d15
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a slight change the to wire protocol. Now out-of-band FDs must
be sent along with the command header bytes.
The code changes exploit that by only using the more complex `recvmsg`
call when reading the command header. Additionally, we explicitly pass
around the list of FDs so that there is no risk of accumulating them.
The same (somewhat ugly) vector type is used everywhere now so that
there is only one allocation to capture the FDs and pass them to the
`Parcel` object.
Test: binderRpcTest
Bug: 185909244
Change-Id: I1f55995ca82338ab9716fb2246c954ac8b16cfe5
|
| |
|
|
|
|
| |
Bug: 185909244
Test: TH
Change-Id: Ic4fc1b1edfe9d69984e785553cd1aaca97a07da3
|
| |
|
|
|
|
|
|
|
|
|
| |
RpcServer previously created new RpcSession instances
using the default transport. There is currently no code
in RpcSession that uses that transport for server sessions,
so this patch initializes the transport to nullptr instead.
Bug: 224644083
Test: atest binderRpcTest
Change-Id: Ie9fa8c9c758821614fb161b360a9935955e7e62b
|
| |
|
|
|
|
|
|
|
|
|
| |
A few methods in RpcServer.cpp take a sockaddr or
sockaddr_storage parameter. To support operating systems
without sockets, e.g. Trusty, this switches those
types to void* and std::array<uint8_t, 128>, respectively.
Test: atest binderRpcTest
Bug: 224644083
Change-Id: I9773a4cf0aedd5ebec22a10cea5b1593067632c5
|
| |
|
|
|
|
|
|
| |
This removes an allocation from the binder RPC calls.
Test: atest binderAllocationLimits
Bug: 230625474
Change-Id: I70ebb4e320323149c3c66809f1077cbf332c07ef
|
| |
|
|
|
|
|
|
|
|
| |
This moves the code that reads from /dev/urandom from RpcServer.cpp
into Utils.cpp so other operating systems can provide their own
implementations by replacing Utils.cpp.
Test: atest binderRpcTest
Bug: 224644083
Change-Id: I2923b25537c07060b830b0d8378df8c969bbd02f
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Binder RPC code uses the TEMP_FAILURE_RETRY macro which
is defined by the C library on Linux but not on other
operating systems. The utils/Compat.h header defines that
macro if not available. This change includes that header
into RPC code.
Test: m
Bug: 224644083
Change-Id: I2637e5260e258f3b2dfeb99e8ea7187c079550f7
|
| |
|
|
|
|
|
|
|
|
| |
Switch RpcTransportRaw to use sendmsg() and recvmsg() over
iovecs to send data from multiple buffers to avoid having
to copy all data into a single large buffer.
Bug: 202878542
Test: atest binderRpcTest
Change-Id: I8ba7fa815040555503160ae41888a0b0efe9e5d2
|
| |
|
|
|
|
|
|
|
|
|
| |
Where this can be used is still limited by sepolicy, but now that we
have examples for how to version the wire protocol, tests, fuzzer
entries, and most performance analysis is done, we can avoid this
function name.
Bug: 167966510
Test: N/A
Change-Id: Ibda9a656f1b96be7d38c4684cab787e411297a24
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When multiple clients connect to a server, we need a way to tell these
clients apart. Having a per-client root object is the easiest way to do
this (the alternative, using getCalling* like is used in binder, isn't
so great because it requires global/thread local place, but given that
many RpcSession objects can be created, and these can also be used in
conjunction with kernel binder, it is complicated figuring out exactly
where to call getCalling*).
Bug: 199259751
Test: binderRpcTest
Change-Id: I5727db618b5ea138bfa19e75ed915f6a6991518e
|
| |
|
|
|
|
|
|
|
| |
We'll add a separate number for outgoing threads
Bug: 194225767
Test: pass
Change-Id: I7bf178c098adc6359582792a2f1ca1248a336b9f
|