stack_clash: Guard functions used only in 64bit
PATCH 1/2 stack_clash: Guard functions used only in 64bit
To avoid "defined but not used" warnings when compiled on 32bit.
--- testcases/cve/stack_clash.c | 4 ++++ 1 file changed, 4 insertions(+)
testcases/cve/stack_clash.c +4 -0
@@ -92,6 +92,7 @@ void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED)_exit (EXIT_SUCCESS ); } +#ifdef __x86_64__static void force_bottom_up (void ) {FILE *fh;
@@ -134,6 +135,7 @@ static void force_bottom_up(void) out: SAFE_FCLOSE(fh); } +#endif unsigned long read_stack_addr_from_proc (unsigned long *stack_size) {
@@ -187,6 +189,7 @@ void __attribute__((noinline)) preallocate_stack(unsigned long required) garbage[0 ] = garbage[required -1 ] ='\0' ; } +#ifdef __x86_64__static void do_mmap_placement_test (unsigned long stack_addr,unsigned long gap) {void *map_test_gap;
@@ -208,6 +211,7 @@ static void do_mmap_placement_test(unsigned long stack_addr, unsigned long gap) SAFE_MUNMAP(map_test_gap, MAPPED_LEN); } } +#endif void do_child (void ) {
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/2 stack_clash: Compile with -Wno-infinite-recursion
The algorithm is based on recursive calling of exhaust_stack_into_sigsegv(), remove the warning.
--- testcases/cve/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/cve/Makefile +1 -1
@@ -7,7 +7,7 @@ include $(top_srcdir)/include/mk/testcases.mk CFLAGS += -D_GNU_SOURCE -stack_clash: CFLAGS += -fno-optimize-sibling-calls +stack_clash: CFLAGS += -fno-optimize-sibling-calls -Wno-infinite-recursion cve-2016-7042: LDLIBS += $(KEYUTILS_LIBS)
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] stack_clash: Compile with -Wno-infinite-recursion
Hi!
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] stack_clash: Compile with -Wno-infinite-recursion
Hi Cyril,
thanks, merged!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 20 lines
To avoid "defined but not used" warnings when compiled on 32bit.
Signed-off-by Petr Vorel <[email protected]>--- testcases/cve/stack_clash.c | 4 ++++ 1 file changed, 4 insertions(+)testcases/cve/stack_clash.c +1
-0@@ -92,6 +92,7 @@ void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED)_exit (EXIT_SUCCESS ); } +#ifdef __x86_64__static void force_bottom_up (void ) {FILE *fh;
testcases/cve/stack_clash.c static void force_bottom_up(void) · line 138
Quoted 4 lines
testcases/cve/stack_clash.c +1
-0@@ -134,6 +135,7 @@ static void force_bottom_up(void) out: SAFE_FCLOSE(fh); } +#endif
Maybe I'm blind but this function does not seem to be called from inside of #ifdef __x86_64__.
Quoted 11 lines
testcases/cve/stack_clash.c +1
-0unsigned long read_stack_addr_from_proc (unsigned long *stack_size) {@@ -187,6 +189,7 @@ void __attribute__((noinline)) preallocate_stack(unsigned long required) garbage[0 ] = garbage[required -1 ] ='\0' ; } +#ifdef __x86_64__static void do_mmap_placement_test (unsigned long stack_addr,unsigned long gap) {void *map_test_gap;
testcases/cve/stack_clash.c static void do_mmap_placement_test(unsigned long stack_addr, unsigned long gap) · line 214
Quoted 4 lines
testcases/cve/stack_clash.c +1
-0@@ -208,6 +211,7 @@ static void do_mmap_placement_test(unsigned long stack_addr, unsigned long gap) SAFE_MUNMAP(map_test_gap, MAPPED_LEN); } } +#endif
This part looks good.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Cyril,
Quoted 9 lines
Hi!
testcases/cve/stack_clash.c
Quoted 8 lines
To avoid "defined but not used" warnings when compiled on 32bit.
Signed-off-by Petr Vorel <[email protected]>--- testcases/cve/stack_clash.c | 4 ++++ 1 file changed, 4 insertions(+)testcases/cve/stack_clash.c +0
-0
Hi Cyril,
Quoted 4 lines
Quoted 4 lines
testcases/cve/stack_clash.c +1
-0+#ifdef __x86_64__static void force_bottom_up (void ) {FILE *fh;
Quoted 8 lines
testcases/cve/stack_clash.c static void force_bottom_up(void) · line 138
Quoted 5 lines
testcases/cve/stack_clash.c +1
-0@@ -134,6 +135,7 @@ static void force_bottom_up(void) out: SAFE_FCLOSE(fh); } +#endif Maybe I'm blind but this function does not seem to be called from inside of #ifdef
__x86_64__.
force_bottom_up() is called only inside do_mmap_placement_test(), which is also wrapped with #ifdef __x86_64_.
I did not notice that, compiler pointed it out :).
Can I merge with your RBT?
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 4 lines
force_bottom_up()is called only insidedo_mmap_placement_test(), which is also wrapped with #ifdef__x86_64_.I did not notice that, compiler pointed it out :).
Ah I was blind yesterday, sorry.
Quoted 1 line
Can I merge with your RBT?
Of course.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Cyril,
Quoted 7 lines
Hi!
Quoted 4 lines
force_bottom_up()is called only insidedo_mmap_placement_test(), which is also wrapped with #ifdef__x86_64_.I did not notice that, compiler pointed it out :).
Ah I was blind yesterday, sorry.
No problem, thanks for a review, merged.
Kind regards,
Petr
Quoted 3 lines
Quoted 1 line
Can I merge with your RBT?
Of course.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp