mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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>
This commit is contained in:
parent
b0eb93cfd5
commit
1ee170ea3f
3 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -104,6 +104,7 @@ static const struct crashtype crashtypes[] = {
|
|||
CRASHTYPE(PANIC),
|
||||
CRASHTYPE(BUG),
|
||||
CRASHTYPE(WARNING),
|
||||
CRASHTYPE(WARNING_MESSAGE),
|
||||
CRASHTYPE(EXCEPTION),
|
||||
CRASHTYPE(LOOP),
|
||||
CRASHTYPE(EXHAUST_STACK),
|
||||
|
|
|
@ -11,6 +11,7 @@ void __init lkdtm_bugs_init(int *recur_param);
|
|||
void lkdtm_PANIC(void);
|
||||
void lkdtm_BUG(void);
|
||||
void lkdtm_WARNING(void);
|
||||
void lkdtm_WARNING_MESSAGE(void);
|
||||
void lkdtm_EXCEPTION(void);
|
||||
void lkdtm_LOOP(void);
|
||||
void lkdtm_EXHAUST_STACK(void);
|
||||
|
|
Loading…
Reference in a new issue