[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/12] check-block: enable iotests with SafeStack
From: |
Stefan Hajnoczi |
Subject: |
[PULL 05/12] check-block: enable iotests with SafeStack |
Date: |
Wed, 24 Jun 2020 11:02:03 +0100 |
From: Daniele Buono <dbuono@linux.vnet.ibm.com>
SafeStack is a stack protection technique implemented in llvm. It is
enabled with a -fsanitize flag.
iotests are currently disabled when any -fsanitize option is used,
because such options tend to produce additional warnings and false
positives.
While common -fsanitize options are used to verify the code and not
added in production, SafeStack's main use is in production environments
to protect against stack smashing.
Since SafeStack does not print any warning or false positive, enable
iotests when SafeStack is the only -fsanitize option used.
This is likely going to be a production binary and we want to make sure
it works correctly.
Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Message-id: 20200529205122.714-5-dbuono@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tests/check-block.sh | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/check-block.sh b/tests/check-block.sh
index ad320c21ba..8e29c868e5 100755
--- a/tests/check-block.sh
+++ b/tests/check-block.sh
@@ -21,7 +21,17 @@ if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ;
then
exit 0
fi
-if grep -q "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ; then
+# Disable tests with any sanitizer except for SafeStack
+CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null )
+SANITIZE_FLAGS=""
+#Remove all occurrencies of -fsanitize=safe-stack
+for i in ${CFLAGS}; do
+ if [ "${i}" != "-fsanitize=safe-stack" ]; then
+ SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}"
+ fi
+done
+if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then
+ # Have a sanitize flag that is not allowed, stop
echo "Sanitizers are enabled ==> Not running the qemu-iotests."
exit 0
fi
--
2.26.2
- [PULL 00/12] Block patches, Stefan Hajnoczi, 2020/06/24
- [PULL 01/12] minikconf: explicitly set encoding to UTF-8, Stefan Hajnoczi, 2020/06/24
- [PULL 02/12] coroutine: support SafeStack in ucontext backend, Stefan Hajnoczi, 2020/06/24
- [PULL 03/12] coroutine: add check for SafeStack in sigaltstack, Stefan Hajnoczi, 2020/06/24
- [PULL 04/12] configure: add flags to support SafeStack, Stefan Hajnoczi, 2020/06/24
- [PULL 05/12] check-block: enable iotests with SafeStack,
Stefan Hajnoczi <=
- [PULL 06/12] block/nvme: poll queues without q->lock, Stefan Hajnoczi, 2020/06/24
- [PULL 07/12] block/nvme: drop tautologous assertion, Stefan Hajnoczi, 2020/06/24
- [PULL 08/12] block/nvme: don't access CQE after moving cq.head, Stefan Hajnoczi, 2020/06/24
- [PULL 09/12] block/nvme: switch to a NVMeRequest freelist, Stefan Hajnoczi, 2020/06/24
- [PULL 10/12] block/nvme: clarify that free_req_queue is protected by q->lock, Stefan Hajnoczi, 2020/06/24
- [PULL 11/12] block/nvme: keep BDRVNVMeState pointer in NVMeQueuePair, Stefan Hajnoczi, 2020/06/24
- [PULL 12/12] block/nvme: support nested aio_poll(), Stefan Hajnoczi, 2020/06/24
- Re: [PULL 00/12] Block patches, Peter Maydell, 2020/06/25