From b223f11b2163a80c30084b14cec8dabe944740f5 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 17 Sep 2020 15:34:03 -0700 Subject: [PATCH] ubsan: make pointer overflow recoverable the way `base` is used must allow 2-complement address overflow. `base` is effectively a virtual pointer, never dereferenced directly. What matters is `base + index`. This is the address that will be dereference and must be valid (it is properly validated). --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef1fd2e..6bf952c 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ clangtest-native: clean @CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang usan: clean - CC=clang CFLAGS="-O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1 + CC=clang CFLAGS="-O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1 usan32: clean CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1