lkdtm: Add tests for NULL pointer dereference
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 14 Dec 2018 15:26:20 +0000 (15:26 +0000)
committerKees Cook <keescook@chromium.org>
Wed, 9 Jan 2019 20:00:31 +0000 (12:00 -0800)
commit59a12205d3c32aee4c13ca36889fdf7cfed31126
treef2de1d775529e2e3b4e57edf669356f2cbec6303
parent4c411157a42f122051ae3469bee0b5cabe89e139
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>
drivers/misc/lkdtm/core.c
drivers/misc/lkdtm/lkdtm.h
drivers/misc/lkdtm/perms.c