From: Jeremy Harris Date: Tue, 10 Dec 2019 13:19:09 +0000 (+0000) Subject: Taint: invert the taint-check implementation control #define X-Git-Url: https://git.exim.org/users/jgh/exim.git/commitdiff_plain/f096bcccb8e4c9ba57d128c2f08c52f7dc94e07d Taint: invert the taint-check implementation control #define --- diff --git a/src/OS/Makefile-FreeBSD b/src/OS/Makefile-FreeBSD index 1a2f8ecab..8dbdab79d 100644 --- a/src/OS/Makefile-FreeBSD +++ b/src/OS/Makefile-FreeBSD @@ -4,7 +4,6 @@ CHOWN_COMMAND=/usr/sbin/chown STRIP_COMMAND=/usr/bin/strip CHMOD_COMMAND=/bin/chmod -CFLAGS += -DTAINT_CHECK_SLOW # FreeBSD Ports no longer insert compatibility symlinks into /usr/bin for # scripting languages which traditionally have had them. diff --git a/src/OS/Makefile-Linux b/src/OS/Makefile-Linux index ae9f249a9..d1d501376 100644 --- a/src/OS/Makefile-Linux +++ b/src/OS/Makefile-Linux @@ -18,6 +18,9 @@ CC=cc CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE CFLAGS_DYNAMIC ?= -shared -rdynamic +# We have mmap/malloc addr spaces separate +CFLAGS += -DTAINT_CHECK_FAST + DBMLIB = -ldb USE_DB = yes diff --git a/src/OS/Makefile-OpenBSD b/src/OS/Makefile-OpenBSD index 8bff1b058..1855e55bd 100644 --- a/src/OS/Makefile-OpenBSD +++ b/src/OS/Makefile-OpenBSD @@ -6,7 +6,6 @@ CHMOD_COMMAND=/bin/chmod CC=cc CFLAGS=-O2 -Wall -Wno-parentheses -Wno-self-assign -Wno-logical-op-parentheses -CFLAGS += -DTAINT_CHECK_SLOW LIBS=-lm diff --git a/src/OS/Makefile-SunOS5 b/src/OS/Makefile-SunOS5 index fc3fd96cf..33cb1f033 100644 --- a/src/OS/Makefile-SunOS5 +++ b/src/OS/Makefile-SunOS5 @@ -1,7 +1,5 @@ # Exim: OS-specific make file for SunOS5 -CFLAGS=-O -DTAINT_CHECK_SLOW - HAVE_ICONV=yes BASENAME_COMMAND=look_for_it diff --git a/src/src/mytypes.h b/src/src/mytypes.h index ceb9f1b55..fd33168f7 100644 --- a/src/src/mytypes.h +++ b/src/src/mytypes.h @@ -137,7 +137,7 @@ is_tainted(const void * p) #if defined(COMPILE_UTILITY) || defined(MACRO_PREDEF) return FALSE; -#elif defined(TAINT_CHECK_SLOW) +#elif !defined(TAINT_CHECK_FAST) extern BOOL is_tainted_fn(const void *); return is_tainted_fn(p); diff --git a/src/src/store.c b/src/src/store.c index fbfd20d1d..a8f5a07fc 100644 --- a/src/src/store.c +++ b/src/src/store.c @@ -180,6 +180,7 @@ static void internal_tainted_free(storeblock *, const char *, int linenumber); /******************************************************************************/ +#ifndef TAINT_CHECK_FAST /* Slower version check, for use when platform intermixes malloc and mmap area addresses. */ @@ -207,6 +208,7 @@ return FALSE; hit: return pool >= POOL_TAINT_BASE; } +#endif void