Skip to contentSkip to conversation

hugemmap34: Disable -fstack-clash-protection

PATCH In review Wei Gao via ltp 2 participants 2 messages Feb 6, 2025 – Feb 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hugemmap34: Disable -fstack-clash-protection

Compiling hugemmap34 with CFLAGS='-fstack-clash-protection' causes gcc to insert additional stack address validation checks during alloca calls. This results in kernel start allocate memory really, eventually triggering an OOM.

Base Jan's suggestion, disable -fstack-clash-protection to allows test to run on larger pool of systems

---
 testcases/kernel/mem/hugetlb/hugemmap/Makefile | 3 +++
 1 file changed, 3 insertions(+)
testcases/kernel/mem/hugetlb/hugemmap/Makefile +3 -0
index 2d651b4aa..6e72e7009 100644
@@ -8,4 +8,7 @@ include $(top_srcdir)/include/mk/testcases.mk
 include $(abs_srcdir)/../Makefile.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
+CFLAGS_no_stack_prot := $(filter-out -fstack-clash-protection, $(CFLAGS))
+
 hugemmap06: CFLAGS+=-pthread
+hugemmap34: CFLAGS=$(CFLAGS_no_stack_prot)
Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw
Quoted 9 lines · Wei Gao

Compiling hugemmap34 with CFLAGS='-fstack-clash-protection' causes gcc to insert additional stack address validation checks during alloca calls. This results in kernel start allocate memory really, eventually triggering an OOM.

Quoted 4 lines

Base Jan's suggestion, disable -fstack-clash-protection to allows test to run on larger pool of systems

Pushed with small tweaks to commit message.

Thanks,
Jan

Quoted 19 lines
---
 testcases/kernel/mem/hugetlb/hugemmap/Makefile | 3 +++
 1 file changed, 3 insertions(+)
testcases/kernel/mem/hugetlb/hugemmap/Makefile +3 -1
index 2d651b4aa..6e72e7009 100644
@@ -8,4 +8,7 @@ include $(top_srcdir)/include/mk/testcases.mk
 include $(abs_srcdir)/../Makefile.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
+CFLAGS_no_stack_prot := $(filter-out -fstack-clash-protection, $(CFLAGS))
+
 hugemmap06: CFLAGS+=-pthread
+hugemmap34: CFLAGS=$(CFLAGS_no_stack_prot)
--

2.35.3

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp