]> git.ipfire.org Git - people/arne_f/kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:07:53 +0000 (09:07 +0200)
commit14c328b46e23fcac4d9e2e38b989827e612e6d1e
tree30ddb8a74acfbb2a74d600b0a6811dddc9533d20
parent52796ff1a545a6fe5d4a5504ae14b871134d0f76
lkdtm: Add tests for NULL pointer dereference

[ Upstream commit 59a12205d3c32aee4c13ca36889fdf7cfed31126 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/lkdtm.h
drivers/misc/lkdtm_core.c
drivers/misc/lkdtm_perms.c