@@ -68,7 +68,8 @@ STARTUP_MEM_USAGE = -DSMALL_MEM_STARTUP=0
6868PRE_POPULATE_PAGES = -DPRE_POPULATE_PAGES=0
6969
7070# # Enable some functionality that like IsoAlloc internals
71- # # for tests that need to verify security properties
71+ # # for tests that need to verify security properties.
72+ # # Only test code should use this.
7273UNIT_TESTING = -DUNIT_TESTING=1
7374
7475# # Enable the malloc/free and new/delete hooks
@@ -183,6 +184,15 @@ AUTO_CTOR_DTOR = -DAUTO_CTOR_DTOR=1
183184# # that call free will segfault
184185ISO_DTOR_CLEANUP = -DISO_DTOR_CLEANUP=0
185186
187+ # # Register a signal handler for SIGSEGV that inspects si_addr
188+ # # for an address managed by IsoAlloc. Optionally used when
189+ # # UAF_PTR_PAGE is enabled for better crash handling
190+ SIGNAL_HANDLER = -DSIGNAL_HANDLER=0
191+
192+ # # If you know your target will have an ARMv8.1-A or newer and
193+ # # supports Top Byte Ignore (TBI) then you want to enable this
194+ ARM_TBI = 0
195+
186196LTO = -flto
187197
188198LIBNAME = libisoalloc.so
@@ -248,8 +258,9 @@ CFLAGS += $(COMMON_CFLAGS) $(SECURITY_FLAGS) $(BUILD_ERROR_FLAGS) $(HOOKS) $(HEA
248258 -std=c11 $(SANITIZER_SUPPORT ) $(ALLOC_SANITY ) $(MEMCPY_SANITY ) $(UNINIT_READ_SANITY ) $(CPU_PIN ) $(SCHED_GETCPU ) \
249259 $(EXPERIMENTAL ) $(UAF_PTR_PAGE ) $(VERIFY_FREE_BIT_SLOTS ) $(NAMED_MAPPINGS ) $(ABORT_ON_NULL ) $(NO_ZERO_ALLOCATIONS ) \
250260 $(ABORT_NO_ENTROPY ) $(ISO_DTOR_CLEANUP ) $(RANDOMIZE_FREELIST ) $(USE_SPINLOCK ) $(HUGE_PAGES ) $(USE_MLOCK ) \
251- $(MEMORY_TAGGING ) $(STRONG_SIZE_ISOLATION ) $(MEMSET_SANITY ) $(AUTO_CTOR_DTOR )
252- CXXFLAGS += $(COMMON_CFLAGS ) -DCPP_SUPPORT=1 -std=c++17 $(SANITIZER_SUPPORT ) $(HOOKS )
261+ $(MEMORY_TAGGING ) $(STRONG_SIZE_ISOLATION ) $(MEMSET_SANITY ) $(AUTO_CTOR_DTOR ) $(SIGNAL_HANDLER )
262+ CXXFLAGS = $(COMMON_CFLAGS ) -DCPP_SUPPORT=1 -std=c++17 $(SANITIZER_SUPPORT ) $(HOOKS )
263+
253264EXE_CFLAGS = -fPIE
254265GDB_FLAGS = -g -ggdb3 -fno-omit-frame-pointer
255266PERF_FLAGS = -pg -DPERF_TEST_BUILD=1
@@ -318,7 +329,7 @@ tests: clean library_debug_unit_tests
318329 @echo " make tests"
319330 $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) tests/rand_freelist.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /rand_freelist $(LDFLAGS )
320331 $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) tests/tests.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /tests $(LDFLAGS )
321- $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) tests/uaf.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /uaf $(LDFLAGS )
332+ $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) $( UNIT_TESTING ) tests/uaf.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /uaf $(LDFLAGS )
322333 $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) tests/interfaces_test.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /interfaces_test $(LDFLAGS )
323334 $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) tests/thread_tests.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /thread_tests $(LDFLAGS )
324335 $(CC ) $(CFLAGS ) $(EXE_CFLAGS ) $(DEBUG_LOG_FLAGS ) $(GDB_FLAGS ) $(OS_FLAGS ) $(UNIT_TESTING ) tests/big_canary_test.c $(ISO_ALLOC_PRINTF_SRC ) -o $(BUILD_DIR ) /big_canary_test $(LDFLAGS )
@@ -400,10 +411,10 @@ install:
400411 cp -pR build/$(LIBNAME ) /usr/lib/
401412
402413format :
403- clang-format $(SRC_DIR ) /* .* tests/* .* include/* .h -i
414+ clang-format-12 $(SRC_DIR ) /* .* tests/* .* include/* .h -i
404415
405416format-ci :
406- clang-format --Werror --dry-run $(SRC_DIR ) /* .* tests/* .* include/* .h -i
417+ clang-format-12 --Werror --dry-run $(SRC_DIR ) /* .* tests/* .* include/* .h -i
407418
408419clean :
409420 rm -rf build/* tests_perf_analysis.txt big_tests_perf_analysis.txt gmon.out test_output.txt * .dSYM core* iso_alloc_profiler.data
0 commit comments