Loading cmds/atrace/atrace.rc +1 −1 Original line number Diff line number Diff line Loading @@ -436,7 +436,7 @@ on late-init && property:ro.boot.hypervisor.vm.supported=1 chmod 0440 /sys/kernel/tracing/hyp/events/hyp/host_mem_abort/id # Ensure correct permissions on GPU related events on late-fs on property:sys.boot_completed=1 chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_frequency/enable chmod 0666 /sys/kernel/tracing/events/power/gpu_frequency/enable chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_work_period/enable Loading libs/adbd_auth/adbd_auth.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -151,8 +151,6 @@ void AdbdAuthContext::HandlePacket(std::string_view packet) EXCLUDES(mutex_) { } if (!handled_packet) { LOG(ERROR) << "adbd_auth: unhandled packet: " << packet; std::lock_guard<std::mutex> lock(mutex_); ReplaceFrameworkFd(unique_fd()); } } Loading libs/adbd_auth/adbd_auth_test.cpp +23 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #include <gtest/gtest.h> #include <assert.h> #include <stddef.h> #include <stdint.h> #include <memory> Loading Loading @@ -138,7 +137,7 @@ class Framework { auto packet_id = runner->Context()->ReceivedPackets(); Send(msg); while(runner->Context()->ReceivedPackets() < packet_id + 1) { while(runner->Context()->ReceivedPackets() == packet_id) { std::this_thread::sleep_for(10ms); } } Loading Loading @@ -253,3 +252,25 @@ TEST(AdbAuthTest, WifiLifeCycle) { framework.SendAndWaitContext("W0", runner.get()); ASSERT_EQ(stop_message_received,true); } TEST(AdbAuthTest, UnhandledPacket) { AdbdAuthCallbacksV2 callbacks{}; callbacks.version = 2; auto runner= CreateContextRunner(callbacks); Framework framework{}; uint16_t port = 19; adbd_auth_send_tls_server_port(runner->Context(), port); // Send an unhandled packet. This should not reset the stack. framework.SendAndWaitContext("XX", runner.get()); // Check that libauth did not reset the socket. auto msg = framework.Recv(); ASSERT_EQ(4, msg.size()); ASSERT_EQ(msg[0], 'T'); ASSERT_EQ(msg[1], 'P'); ASSERT_EQ(msg[2], port); ASSERT_EQ(msg[3], 0); } libs/binder/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -910,9 +910,12 @@ aidl_interface { local_include_dir: "aidl", host_supported: true, srcs: [ "aidl/android/content/pm/ApexStagedEvent.aidl", "aidl/android/content/pm/IPackageManagerNative.aidl", "aidl/android/content/pm/IStagedApexObserver.aidl", "aidl/android/content/pm/ApexStagedEvent.aidl", "aidl/android/content/pm/PackageInfoNative.aidl", "aidl/android/content/pm/SignatureNative.aidl", "aidl/android/content/pm/SigningInfoNative.aidl", "aidl/android/content/pm/StagedApexInfo.aidl", ], backend: { Loading @@ -922,6 +925,10 @@ aidl_interface { "com.android.virt", ], enabled: true, gen_mockall: true, additional_rustlibs: [ "libmockall", ], }, }, } Loading libs/binder/IPCThreadState.cpp +12 −7 Original line number Diff line number Diff line Loading @@ -1597,15 +1597,18 @@ status_t IPCThreadState::executeCommand(int32_t cmd) proxy->sendObituary(); mOut.writeInt32(BC_DEAD_BINDER_DONE); mOut.writePointer((uintptr_t)proxy); } break; } break; case BR_CLEAR_DEATH_NOTIFICATION_DONE: { BpBinder *proxy = (BpBinder*)mIn.readPointer(); proxy->getWeakRefs()->decWeak(proxy); } break; } break; case BR_FROZEN_BINDER: { case BR_FROZEN_BINDER: { const struct binder_frozen_state_info* data = reinterpret_cast<const struct binder_frozen_state_info*>( mIn.readInplace(sizeof(struct binder_frozen_state_info))); Loading @@ -1614,16 +1617,18 @@ status_t IPCThreadState::executeCommand(int32_t cmd) break; } BpBinder* proxy = (BpBinder*)data->cookie; bool isFrozen = mIn.readInt32() > 0; proxy->getPrivateAccessor().onFrozenStateChanged(data->is_frozen); mOut.writeInt32(BC_FREEZE_NOTIFICATION_DONE); mOut.writePointer(data->cookie); } break; } break; case BR_CLEAR_FREEZE_NOTIFICATION_DONE: { case BR_CLEAR_FREEZE_NOTIFICATION_DONE: { BpBinder* proxy = (BpBinder*)mIn.readPointer(); proxy->getWeakRefs()->decWeak(proxy); } break; } break; case BR_FINISHED: result = TIMED_OUT; Loading Loading
cmds/atrace/atrace.rc +1 −1 Original line number Diff line number Diff line Loading @@ -436,7 +436,7 @@ on late-init && property:ro.boot.hypervisor.vm.supported=1 chmod 0440 /sys/kernel/tracing/hyp/events/hyp/host_mem_abort/id # Ensure correct permissions on GPU related events on late-fs on property:sys.boot_completed=1 chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_frequency/enable chmod 0666 /sys/kernel/tracing/events/power/gpu_frequency/enable chmod 0666 /sys/kernel/debug/tracing/events/power/gpu_work_period/enable Loading
libs/adbd_auth/adbd_auth.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -151,8 +151,6 @@ void AdbdAuthContext::HandlePacket(std::string_view packet) EXCLUDES(mutex_) { } if (!handled_packet) { LOG(ERROR) << "adbd_auth: unhandled packet: " << packet; std::lock_guard<std::mutex> lock(mutex_); ReplaceFrameworkFd(unique_fd()); } } Loading
libs/adbd_auth/adbd_auth_test.cpp +23 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ #include <gtest/gtest.h> #include <assert.h> #include <stddef.h> #include <stdint.h> #include <memory> Loading Loading @@ -138,7 +137,7 @@ class Framework { auto packet_id = runner->Context()->ReceivedPackets(); Send(msg); while(runner->Context()->ReceivedPackets() < packet_id + 1) { while(runner->Context()->ReceivedPackets() == packet_id) { std::this_thread::sleep_for(10ms); } } Loading Loading @@ -253,3 +252,25 @@ TEST(AdbAuthTest, WifiLifeCycle) { framework.SendAndWaitContext("W0", runner.get()); ASSERT_EQ(stop_message_received,true); } TEST(AdbAuthTest, UnhandledPacket) { AdbdAuthCallbacksV2 callbacks{}; callbacks.version = 2; auto runner= CreateContextRunner(callbacks); Framework framework{}; uint16_t port = 19; adbd_auth_send_tls_server_port(runner->Context(), port); // Send an unhandled packet. This should not reset the stack. framework.SendAndWaitContext("XX", runner.get()); // Check that libauth did not reset the socket. auto msg = framework.Recv(); ASSERT_EQ(4, msg.size()); ASSERT_EQ(msg[0], 'T'); ASSERT_EQ(msg[1], 'P'); ASSERT_EQ(msg[2], port); ASSERT_EQ(msg[3], 0); }
libs/binder/Android.bp +8 −1 Original line number Diff line number Diff line Loading @@ -910,9 +910,12 @@ aidl_interface { local_include_dir: "aidl", host_supported: true, srcs: [ "aidl/android/content/pm/ApexStagedEvent.aidl", "aidl/android/content/pm/IPackageManagerNative.aidl", "aidl/android/content/pm/IStagedApexObserver.aidl", "aidl/android/content/pm/ApexStagedEvent.aidl", "aidl/android/content/pm/PackageInfoNative.aidl", "aidl/android/content/pm/SignatureNative.aidl", "aidl/android/content/pm/SigningInfoNative.aidl", "aidl/android/content/pm/StagedApexInfo.aidl", ], backend: { Loading @@ -922,6 +925,10 @@ aidl_interface { "com.android.virt", ], enabled: true, gen_mockall: true, additional_rustlibs: [ "libmockall", ], }, }, } Loading
libs/binder/IPCThreadState.cpp +12 −7 Original line number Diff line number Diff line Loading @@ -1597,15 +1597,18 @@ status_t IPCThreadState::executeCommand(int32_t cmd) proxy->sendObituary(); mOut.writeInt32(BC_DEAD_BINDER_DONE); mOut.writePointer((uintptr_t)proxy); } break; } break; case BR_CLEAR_DEATH_NOTIFICATION_DONE: { BpBinder *proxy = (BpBinder*)mIn.readPointer(); proxy->getWeakRefs()->decWeak(proxy); } break; } break; case BR_FROZEN_BINDER: { case BR_FROZEN_BINDER: { const struct binder_frozen_state_info* data = reinterpret_cast<const struct binder_frozen_state_info*>( mIn.readInplace(sizeof(struct binder_frozen_state_info))); Loading @@ -1614,16 +1617,18 @@ status_t IPCThreadState::executeCommand(int32_t cmd) break; } BpBinder* proxy = (BpBinder*)data->cookie; bool isFrozen = mIn.readInt32() > 0; proxy->getPrivateAccessor().onFrozenStateChanged(data->is_frozen); mOut.writeInt32(BC_FREEZE_NOTIFICATION_DONE); mOut.writePointer(data->cookie); } break; } break; case BR_CLEAR_FREEZE_NOTIFICATION_DONE: { case BR_CLEAR_FREEZE_NOTIFICATION_DONE: { BpBinder* proxy = (BpBinder*)mIn.readPointer(); proxy->getWeakRefs()->decWeak(proxy); } break; } break; case BR_FINISHED: result = TIMED_OUT; Loading