2020-06-09 07:51:17 +05:30
|
|
|
dir=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
CONFIG_SLAB_CANARY := true
|
2022-01-02 09:48:52 +05:30
|
|
|
# Clang 13 still doesn't enable sized deallocation by default
|
|
|
|
CXXFLAGS := -std=c++17 -fsized-deallocation
|
2020-06-09 07:51:17 +05:30
|
|
|
|
|
|
|
ifeq (,$(filter $(CONFIG_SLAB_CANARY),true false))
|
|
|
|
$(error CONFIG_SLAB_CANARY must be true or false)
|
|
|
|
endif
|
|
|
|
|
2021-11-03 00:52:05 +05:30
|
|
|
CPPFLAGS += -D_GNU_SOURCE \
|
|
|
|
-DSLAB_CANARY=$(CONFIG_SLAB_CANARY)
|
2020-06-09 07:51:17 +05:30
|
|
|
|
|
|
|
LDLIBS := -lhardened_malloc
|
|
|
|
|
|
|
|
LDFLAGS := -Wl,-L$(dir)../../,-R,$(dir)../../
|
|
|
|
|
2018-08-24 14:55:25 +05:30
|
|
|
EXECUTABLES := \
|
2018-08-24 12:39:23 +05:30
|
|
|
double_free_large \
|
2018-08-24 15:23:17 +05:30
|
|
|
double_free_large_delayed \
|
2018-08-24 12:39:23 +05:30
|
|
|
double_free_small \
|
2018-08-24 15:23:17 +05:30
|
|
|
double_free_small_delayed \
|
2018-08-24 12:39:23 +05:30
|
|
|
unaligned_free_large \
|
|
|
|
unaligned_free_small \
|
|
|
|
read_after_free_large \
|
|
|
|
read_after_free_small \
|
|
|
|
write_after_free_large \
|
2018-10-09 03:11:06 +05:30
|
|
|
write_after_free_large_reuse \
|
2018-08-24 12:39:23 +05:30
|
|
|
write_after_free_small \
|
2018-10-09 03:11:06 +05:30
|
|
|
write_after_free_small_reuse \
|
2018-08-24 12:39:23 +05:30
|
|
|
read_zero_size \
|
|
|
|
write_zero_size \
|
2018-08-24 14:15:48 +05:30
|
|
|
invalid_free_protected \
|
|
|
|
invalid_free_unprotected \
|
|
|
|
invalid_free_small_region \
|
2018-08-24 14:39:33 +05:30
|
|
|
invalid_free_small_region_far \
|
2021-12-27 17:47:58 +05:30
|
|
|
uninitialized_read_small \
|
|
|
|
uninitialized_read_large \
|
2018-08-24 14:32:00 +05:30
|
|
|
uninitialized_free \
|
|
|
|
uninitialized_realloc \
|
|
|
|
uninitialized_malloc_usable_size \
|
2018-09-04 18:36:23 +05:30
|
|
|
eight_byte_overflow_small \
|
|
|
|
eight_byte_overflow_large \
|
2018-10-11 11:14:41 +05:30
|
|
|
string_overflow \
|
2020-04-16 09:32:16 +05:30
|
|
|
delete_type_size_mismatch \
|
2020-09-18 02:53:13 +05:30
|
|
|
unaligned_malloc_usable_size_small \
|
|
|
|
invalid_malloc_usable_size_small \
|
|
|
|
invalid_malloc_usable_size_small_quarantine \
|
|
|
|
malloc_object_size \
|
|
|
|
malloc_object_size_offset \
|
|
|
|
invalid_malloc_object_size_small \
|
2021-12-28 16:57:28 +05:30
|
|
|
invalid_malloc_object_size_small_quarantine \
|
|
|
|
impossibly_large_malloc
|
2018-08-24 14:55:25 +05:30
|
|
|
|
|
|
|
all: $(EXECUTABLES)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(EXECUTABLES)
|