[LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement

Siddhesh Poyarekar siddhesh@gotplt.org
Wed Apr 2 19:07:18 CEST 2025


When the input compiler defaults to AVX enabled, stack realignment
requirements causes gcc to fail to omit %rbp use, due to which the test
fails to clobber %rbp in inline asm.  Bump up the preferred stack
boundary to avoid this stack realignment for AVX, so the frame pointer
omission goes through.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
 testcases/cve/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index 01b9b9ccb..06bd1b3db 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -22,6 +22,9 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
 meltdown: CFLAGS += -msse2
 endif
 
-cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
+# The test needs to clobber %rbp, which requires frame pointer omission.  Also
+# bump up the preferred stack boundary to ensure that the compiler manages to
+# omit the frame pointer even with AVX enabled.
+cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer -mpreferred-stack-boundary=5
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-- 
2.49.0



More information about the ltp mailing list