[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <105ec9a308b2abedb1a0d1fdced0c22d765e4732.1519924383.git.andreyknvl@google.com>
Date: Thu, 1 Mar 2018 18:15:43 +0100
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Nick Terrell <terrelln@...com>, Chris Mason <clm@...com>,
Yury Norov <ynorov@...iumnetworks.com>,
Al Viro <viro@...iv.linux.org.uk>,
"Luis R . Rodriguez" <mcgrof@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
Jeff Layton <jlayton@...hat.com>,
"Jason A . Donenfeld" <Jason@...c4.com>,
linux-kernel@...r.kernel.org, kasan-dev@...glegroups.com,
linux-mm@...ck.org
Cc: Kostya Serebryany <kcc@...gle.com>,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: [PATCH 2/2] kasan: disallow compiler to optimize away memset in tests
A compiler can optimize away memset calls by replacing them with mov
instructions. There are KASAN tests, that specifically test that KASAN
correctly handles memset calls, we don't want this optimization to
happen.
The solution is to add -fno-builtin flag to test_kasan.ko
Signed-off-by: Andrey Konovalov <andreyknvl@...gle.com>
---
lib/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Makefile b/lib/Makefile
index a90d4fcd748f..9c940c4c0593 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -52,6 +52,7 @@ obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
obj-$(CONFIG_TEST_SYSCTL) += test_sysctl.o
obj-$(CONFIG_TEST_HASH) += test_hash.o test_siphash.o
obj-$(CONFIG_TEST_KASAN) += test_kasan.o
+CFLAGS_test_kasan.o += -fno-builtin
obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
obj-$(CONFIG_TEST_LIST_SORT) += test_list_sort.o
obj-$(CONFIG_TEST_LKM) += test_module.o
--
2.16.2.395.g2e18187dfd-goog
Powered by blists - more mailing lists