[exim-cvs] Taint: invert the taint-check implementation cont…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Taint: invert the taint-check implementation control #define
Gitweb: https://git.exim.org/exim.git/commitdiff/f096bcccb8e4c9ba57d128c2f08c52f7dc94e07d
Commit:     f096bcccb8e4c9ba57d128c2f08c52f7dc94e07d
Parent:     adc4ecf9c7fc0a78c471c6794f5b2e62a396c301
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Dec 10 13:19:09 2019 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Dec 10 16:02:48 2019 +0000


    Taint: invert the taint-check implementation control #define
---
 src/OS/Makefile-FreeBSD | 1 -
 src/OS/Makefile-Linux   | 3 +++
 src/OS/Makefile-OpenBSD | 1 -
 src/OS/Makefile-SunOS5  | 2 --
 src/src/mytypes.h       | 2 +-
 src/src/store.c         | 2 ++
 6 files changed, 6 insertions(+), 5 deletions(-)


diff --git a/src/OS/Makefile-FreeBSD b/src/OS/Makefile-FreeBSD
index 1a2f8ec..8dbdab7 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 ae9f249..d1d5013 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 8bff1b0..1855e55 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 fc3fd96..33cb1f0 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 ceb9f1b..fd33168 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 fbfd20d..a8f5a07 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