|
Message-ID: <580611da-fd97-e82e-b604-581f105416ee@rasmusvillemoes.dk> Date: Tue, 18 Jun 2019 09:10:13 +0200 From: Rasmus Villemoes <linux@...musvillemoes.dk> To: Kees Cook <keescook@...omium.org> Cc: Thomas Gleixner <tglx@...utronix.de>, Linus Torvalds <torvalds@...ux-foundation.org>, Peter Zijlstra <peterz@...radead.org>, Dave Hansen <dave.hansen@...el.com>, linux-kernel@...r.kernel.org, kernel-hardening@...ts.openwall.com Subject: Re: [PATCH v3 1/3] lkdtm: Check for SMEP clearing protections On 18/06/2019 06.55, Kees Cook wrote: > +#else > + pr_err("FAIL: this test is x86_64-only\n"); > +#endif > +} Why expose it at all on all other architectures? If you wrap the CRASHTYPE() in an #ifdef, you can also guard the whole lkdtm_UNSET_SMEP definition (the declaration in lkdtm.h can stay, possibly with a comment saying /* x86-64 only */). > diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c > index b51cf182b031..58cfd713f8dc 100644 > --- a/drivers/misc/lkdtm/core.c > +++ b/drivers/misc/lkdtm/core.c > @@ -123,6 +123,7 @@ static const struct crashtype crashtypes[] = { > CRASHTYPE(CORRUPT_LIST_ADD), > CRASHTYPE(CORRUPT_LIST_DEL), > CRASHTYPE(CORRUPT_USER_DS), > + CRASHTYPE(UNSET_SMEP), > CRASHTYPE(CORRUPT_STACK), > CRASHTYPE(CORRUPT_STACK_STRONG), > CRASHTYPE(STACK_GUARD_PAGE_LEADING), > diff --git a/drivers/misc/lkdtm/lkdtm.h b/drivers/misc/lkdtm/lkdtm.h > index b69ee004a3f7..d7eb5a8f1da4 100644 > --- a/drivers/misc/lkdtm/lkdtm.h > +++ b/drivers/misc/lkdtm/lkdtm.h > @@ -26,6 +26,7 @@ void lkdtm_CORRUPT_LIST_DEL(void); > void lkdtm_CORRUPT_USER_DS(void); > void lkdtm_STACK_GUARD_PAGE_LEADING(void); > void lkdtm_STACK_GUARD_PAGE_TRAILING(void); > +void lkdtm_UNSET_SMEP(void); > > /* lkdtm_heap.c */ > void lkdtm_OVERWRITE_ALLOCATION(void); Rasmus
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.