[PATCH] lkdtm: cfi: add test for HW landing pad CFI

Mark Brown broonie at kernel.org
Thu Jul 14 05:06:38 PDT 2022


On Thu, Jul 14, 2022 at 12:31:54PM +0100, Mark Rutland wrote:
> On Wed, Jul 13, 2022 at 05:13:57PM +0100, Mark Brown wrote:

> > Not sure that worrying about that at this point isn't making perfect the
> > enemy of good though, it could be dealt with later.  Perhaps just put
> > the offset behind a #define to make it a tiny bit more discoverable?

> How about I just add a comment for now? e.g.

> 	/*
> 	 * Skip past a landing pad instruction.
> 	 * On arm64 all instructions are 4-byte aligned, and x86's ENDBR is 4
> 	 * bytes.
> 	 */

I'd rather have something that will definitely either fail or skip the
test so it can't silently pass, if people need to look at the source to
discover this there's more chance they'll mistakenly think things are
working.  Something like

#ifdef __aarch64__
#define LANDING_PAD_SKIP 4
#elif defined (__x86_64__)
#define LANDING_PAD_SKIP 4
#endif

then #ifdef LANDING_PAD_SKIP around the test perhaps?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220714/09a507ca/attachment.sig>


More information about the linux-arm-kernel mailing list