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

Commit 44169bbd authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: increase trans limit a lot

Bug: 424526253
Bug: 424296972
Test: binderRpcTest
Flag: EXEMPT bugfix
Change-Id: Ia17b4033600603291b1f861c007447e9462fe377
parent 8443b19b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,4 +36,7 @@ constexpr size_t kLogTransactionsOverBytes = 300 * 1024;
 */
constexpr size_t kRpcTransactionLimitBytes = 600 * 1024;

// TODO(b/424526253): remove high limit again
constexpr size_t kRpcTransactionTemporaryLimitBytes = 20 * 1024 * 1024;

} // namespace android::binder
+7 −2
Original line number Diff line number Diff line
@@ -361,9 +361,14 @@ RpcState::CommandData::CommandData(size_t size) : mSize(size) {
    // transaction (in some cases, additional fixed size amounts are added),
    // though for rough consistency, we should avoid cases where this data type
    // is used for multiple dynamic allocations for a single transaction.
    if (size > binder::kRpcTransactionLimitBytes) {
        ALOGE("Transaction requested too much data allocation: %zu bytes, failing.", size);
    if (size > binder::kRpcTransactionTemporaryLimitBytes) {
        ALOGE("Transaction requested WAY WAY WAY too much data allocation: %zu bytes, failing.",
              size);
        return;
    } else if (size > binder::kRpcTransactionLimitBytes) {
        ALOGE("Transaction requested too much data allocation: %zu bytes, this will become a "
              "failure!!!",
              size);
    } else if (size > binder::kLogTransactionsOverBytes) {
        ALOGW("Transaction too large: inefficient and in danger of breaking: %zu bytes.", size);
    }
+2 −1
Original line number Diff line number Diff line
@@ -713,6 +713,7 @@ TEST_P(BinderRpc, OnewayCallExhaustion) {
}

// TODO(b/392717039): can we move this to universal tests?
// TODO(b/424526253): restore limit down
TEST_P(BinderRpc, SendTooLargeVector) {
    if (GetParam().singleThreaded) {
        GTEST_SKIP() << "Requires multi-threaded server to test one of the sessions crashing.";
@@ -724,7 +725,7 @@ TEST_P(BinderRpc, SendTooLargeVector) {
    EXPECT_EQ(OK, proc.rootBinder->pingBinder());

    // see libbinder internal Constants.h
    const size_t kTooLargeSize = 650 * 1024;
    const size_t kTooLargeSize = 25 * 1024 * 1024;
    const std::vector<uint8_t> kTestValue(kTooLargeSize / sizeof(uint8_t), 42);

    // TODO(b/392717039): Telling a server to allocate too much data currently causes the session to