Thread (5 messages) flat view 5 messages, 2 authors, 2019-01-09

Re: [PATCH] lkdtm: Add a tests for NULL pointer dereference

From: Kees Cook <hidden>
Date: 2019-01-09 20:05:20
Also in: lkml

On Wed, Jan 9, 2019 at 7:16 AM Kees Cook [off-list ref] wrote:
On Tue, Jan 8, 2019 at 10:31 PM Christophe Leroy
[off-list ref] wrote:
quoted


Le 09/01/2019 à 02:14, Kees Cook a écrit :
quoted
On Fri, Dec 14, 2018 at 7:26 AM Christophe Leroy
[off-list ref] wrote:
quoted
Introduce lkdtm tests for NULL pointer dereference: check
access or exec at NULL address.
Why is this not already covered by the existing tests? (Is there
something special about NULL that is being missed?) I'd expect SMAP
and SMEP to cover NULL as well.
Most arches print a different message whether the faulty address is
above or under PAGE_SIZE. Below is exemple from x86:

        pr_alert("BUG: unable to handle kernel %s at %px\n",
                 address < PAGE_SIZE ? "NULL pointer dereference" : "paging request",
                 (void *)address);


Until recently, the powerpc arch didn't do it. When I implemented it
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=49a502ea23bf9dec47f8f3c3960909ff409cd1bb),
I needed a way to test it and couldn't find an existing one, hence this
new LKDTM test.

But maybe I missed something ?
Okay, gotcha. You're getting more complete reporting coverage. Sounds
good to me. Thanks!

Acked-by: Kees Cook <redacted>
Applied to my lkdtm -next tree.

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help