Skip to content
Commit f68022ae authored by Kristina Martsenko's avatar Kristina Martsenko Committed by Kees Cook
Browse files

lkdtm: cfi: Make PAC test work with GCC 7 and 8



The CFI test uses the branch-protection=none compiler attribute to
disable PAC return address protection on a function. While newer GCC
versions support this attribute, older versions (GCC 7 and 8) instead
supported the sign-return-address=none attribute, leading to a build
failure when the test is built with older compilers. Fix it by checking
which attribute is supported and using the correct one.

Fixes: 2e53b877 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations")
Reported-by: default avatarDaniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: default avatarKristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/all/CAEUSe78kDPxQmQqCWW-_9LCgJDFhAeMoVBFnX9QLx18Z4uT4VQ@mail.gmail.com/
parent 00dd027f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment