]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
lkdtm: include WARN format string
authorKees Cook <keescook@chromium.org>
Fri, 17 Nov 2017 23:27:17 +0000 (15:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 00:10:01 +0000 (16:10 -0800)
In order to test the ordering of WARN format strings, actually include
one in LKDTM.

Link: http://lkml.kernel.org/r/1510100869-73751-2-git-send-email-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/misc/lkdtm_bugs.c

index b0f7af872bb56c40759201c363a0b3812c30b04b..7eebbdfbcacd0a51aef6f1d0c70e794b45ac3c03 100644 (file)
@@ -63,9 +63,11 @@ void lkdtm_BUG(void)
        BUG();
 }
 
+static int warn_counter;
+
 void lkdtm_WARNING(void)
 {
-       WARN_ON(1);
+       WARN(1, "Warning message trigger count: %d\n", warn_counter++);
 }
 
 void lkdtm_EXCEPTION(void)