diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-12-14 18:26:20 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2019-01-09 23:00:31 +0300 |
commit | 59a12205d3c32aee4c13ca36889fdf7cfed31126 (patch) | |
tree | f2de1d775529e2e3b4e57edf669356f2cbec6303 /drivers/misc/lkdtm/core.c | |
parent | 4c411157a42f122051ae3469bee0b5cabe89e139 (diff) | |
download | linux-59a12205d3c32aee4c13ca36889fdf7cfed31126.tar.xz |
lkdtm: Add tests for NULL pointer dereference
Introduce lkdtm tests for NULL pointer dereference: check access or exec
at NULL address, since these errors tend to be reported differently from
the general fault error text. For example from x86:
pr_alert("BUG: unable to handle kernel %s at %px\n",
address < PAGE_SIZE ? "NULL pointer dereference" : "paging request",
(void *)address);
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/misc/lkdtm/core.c')
-rw-r--r-- | drivers/misc/lkdtm/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c index 5d41c2230d2e..c09133ac9803 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -143,7 +143,9 @@ static const struct crashtype crashtypes[] = { CRASHTYPE(EXEC_VMALLOC), CRASHTYPE(EXEC_RODATA), CRASHTYPE(EXEC_USERSPACE), + CRASHTYPE(EXEC_NULL), CRASHTYPE(ACCESS_USERSPACE), + CRASHTYPE(ACCESS_NULL), CRASHTYPE(WRITE_RO), CRASHTYPE(WRITE_RO_AFTER_INIT), CRASHTYPE(WRITE_KERN), |