check-block: enable iotests with cfi-icall
cfi-icall is a form of Control-Flow Integrity for indirect function calls implemented by llvm. It is enabled with a -fsanitize flag. iotests are currently disabled when -fsanitize options is used, with the exception of SafeStack. This patch implements a generic filtering mechanism to allow iotests with a set of known-to-be-safe -fsanitize option. Then marks SafeStack and the new options used for cfi-icall safe for iotests Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com> Message-Id: <20201204230615.2392-4-dbuono@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c905a3680d
commit
24496fe851
@ -21,14 +21,18 @@ if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable tests with any sanitizer except for SafeStack
|
# Disable tests with any sanitizer except for specific ones
|
||||||
CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
|
SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
|
||||||
SANITIZE_FLAGS=""
|
ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall"
|
||||||
#Remove all occurrencies of -fsanitize=safe-stack
|
#Remove all occurrencies of allowed Sanitize flags
|
||||||
for i in ${CFLAGS}; do
|
for j in ${ALLOWED_SANITIZE_FLAGS}; do
|
||||||
if [ "${i}" != "-fsanitize=safe-stack" ]; then
|
TMP_FLAGS=${SANITIZE_FLAGS}
|
||||||
SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
|
SANITIZE_FLAGS=""
|
||||||
|
for i in ${TMP_FLAGS}; do
|
||||||
|
if ! echo ${i} | grep -q "${j}" 2>/dev/null; then
|
||||||
|
SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
|
if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
|
||||||
# Have a sanitize flag that is not allowed, stop
|
# Have a sanitize flag that is not allowed, stop
|
||||||
|
Loading…
Reference in New Issue
Block a user