Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f2e4725 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder: Duplicate channel handle in RpcServerTrusty" am: ad08ac99...

Merge "libbinder: Duplicate channel handle in RpcServerTrusty" am: ad08ac99 am: e7f263f1 am: 8770ca6b

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2402152



Change-Id: Idb4f40dd0a46b4d29ef5a184b413460a72867ee4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1d104209 8770ca6b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -117,7 +117,15 @@ int RpcServerTrusty::handleConnect(const tipc_port* port, handle_t chan, const u
        *ctx_p = channelContext;
    };

    base::unique_fd clientFd(chan);
    // We need to duplicate the channel handle here because the tipc library
    // owns the original handle and closes is automatically on channel cleanup.
    // We use dup() because Trusty does not have fcntl().
    // NOLINTNEXTLINE(android-cloexec-dup)
    handle_t chanDup = dup(chan);
    if (chanDup < 0) {
        return chanDup;
    }
    base::unique_fd clientFd(chanDup);
    android::RpcTransportFd transportFd(std::move(clientFd));

    std::array<uint8_t, RpcServer::kRpcAddressSize> addr;