[LTP] [PATCH] cve-2015-3290: build with O0

Cyril Hrubis chrubis@suse.cz
Fri Nov 29 13:10:08 CET 2024


Hi!
> Hit a compile broken for this test in rhel10 gcc-14.2.1-6.el10.x86_64
> and find only with O0 it could be compiled pass.
> 
> CC testcases/cve/cve-2014-0196
> cve-2015-3290.c: In function ‘child_thread’:
> cve-2015-3290.c:437:1: error: bp cannot be used in ‘asm’ here
>   437 | }
>       | ^
> make: *** [../../include/mk/rules.mk:45: cve-2015-3290] Error 1

Exactly this should be solved by -fomit-frame-pointer, at least that how
the problem is fixed for most of the gcc releases. Also the original
exploit is supposed to be build with -O2 so I do not think that this is
the right fix.

> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
> ---
>  testcases/cve/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
> index 01b9b9ccb..2a769dea8 100644
> --- a/testcases/cve/Makefile
> +++ b/testcases/cve/Makefile
> @@ -22,6 +22,6 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
>  meltdown: CFLAGS += -msse2
>  endif
>  
> -cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
> +cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer -O0
>  
>  include $(top_srcdir)/include/mk/generic_leaf_target.mk
> -- 
> 2.47.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list