summaryrefslogtreecommitdiff
path: root/drivers/misc/lkdtm/bugs.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-08-19 20:24:52 +0300
committerKees Cook <keescook@chromium.org>2019-08-19 21:13:21 +0300
commit1ee170ea3f0dcf3a4b34f7e7c36559e84bb0d3d6 (patch)
tree103a354bd200370888a73fe1ebdb2e1ad517f735 /drivers/misc/lkdtm/bugs.c
parentb0eb93cfd516201ccf0e4d36e226cfe1b16cc1fe (diff)
downloadlinux-1ee170ea3f0dcf3a4b34f7e7c36559e84bb0d3d6.tar.xz
lkdtm: Split WARNING into separate tests
There are three paths through the kernel code exception logging: - BUG (no configurable printk message) - WARN_ON (no configurable printk message) - WARN (configurable printk message) LKDTM was not testing WARN_ON(). This is needed to evaluate the placement of the "cut here" line, which needs special handling in each of the three exceptions (and between architectures that implement instruction exceptions to implement the code exceptions). Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/misc/lkdtm/bugs.c')
-rw-r--r--drivers/misc/lkdtm/bugs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
index 1606658b9b7e..98fad7909592 100644
--- a/drivers/misc/lkdtm/bugs.c
+++ b/drivers/misc/lkdtm/bugs.c
@@ -75,7 +75,12 @@ static int warn_counter;
void lkdtm_WARNING(void)
{
- WARN(1, "Warning message trigger count: %d\n", warn_counter++);
+ WARN_ON(++warn_counter);
+}
+
+void lkdtm_WARNING_MESSAGE(void)
+{
+ WARN(1, "Warning message trigger count: %d\n", ++warn_counter);
}
void lkdtm_EXCEPTION(void)