summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKees Cook2018-06-26 00:59:34 +0200
committerKees Cook2018-10-11 17:17:50 +0200
commit0bb95f80a38f82884693194ea720e9cca5e12ada (patch)
tree788e8ef11abfc6b7dc7cd0ba6b7f23fa2f6b95e1 /Makefile
parentcompiler.h: give up __compiletime_assert_fallback() (diff)
downloadkernel-qcow2-linux-0bb95f80a38f82884693194ea720e9cca5e12ada.tar.gz
kernel-qcow2-linux-0bb95f80a38f82884693194ea720e9cca5e12ada.tar.xz
kernel-qcow2-linux-0bb95f80a38f82884693194ea720e9cca5e12ada.zip
Makefile: Globally enable VLA warning
Now that Variable Length Arrays (VLAs) have been entirely removed[1] from the kernel, enable the VLA warning globally. The only exceptions to this are the KASan an UBSan tests which are explicitly checking that VLAs trigger their respective tests. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: David Airlie <airlied@linux.ie> Cc: linux-kbuild@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 19948e556941..f1760e8db573 100644
--- a/Makefile
+++ b/Makefile
@@ -804,6 +804,9 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
# warn about C99 declaration after statement
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
+# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
+KBUILD_CFLAGS += $(call cc-option,-Wvla)
+
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)