mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 11:53:07 -05:00
Allocate unique near trampolines without MAP_FIXED, gate hooks until install completes, and make pt_attach/pt_call wait and stack alignment fail-closed so controller use during inject cannot corrupt ShellUI.
20 lines
630 B
C++
20 lines
630 B
C++
/* Host tests for the Installing -> Ready hook barrier. */
|
|
#include "test_harness.h"
|
|
#include "hook_lifecycle.hpp"
|
|
|
|
static int test_hook_lifecycle_barrier() {
|
|
shellui_hooks_publish_failed();
|
|
TEST_ASSERT_TRUE(!shellui_hooks_are_ready());
|
|
shellui_hooks_begin_install();
|
|
TEST_ASSERT_TRUE(!shellui_hooks_are_ready());
|
|
shellui_hooks_publish_ready();
|
|
TEST_ASSERT_TRUE(shellui_hooks_are_ready());
|
|
shellui_hooks_publish_failed();
|
|
TEST_ASSERT_TRUE(!shellui_hooks_are_ready());
|
|
return 0;
|
|
}
|
|
|
|
extern "C" int test_hook_lifecycle_suite(void) {
|
|
return onion_test_run("hook_lifecycle.barrier", test_hook_lifecycle_barrier);
|
|
}
|