Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1206377

Re: [PATCH v8 00/21] Compile-time stack validation

From Chris J Arges <chris.j.arges@canonical.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 00/21] Compile-time stack validation
Date 2015-08-12 23:30 +0200
Message-ID <pWLKW-7ZX-9@gated-at.bofh.it> (permalink)
References <pWpr4-C5-3@gated-at.bofh.it> <pWw9b-1QH-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


<snip>
> 
> Thanks for trying it out.  I couldn't figure out how to recreate this
> exact error, but I played around with "make mrproper" and saw some
> probably related errors.  Does this fix it?
> 
> ---8<---
> 
> Subject: [PATCH] stackvalidate: fix circular build dependencies
> 
> After "make mrproper" with CONFIG_STACK_VALIDATION enabled, I get the
> following errors:
> 
>   make[2]: *** No rule to make target 'arch/x86/purgatory/purgatory.o', needed by 'arch/x86/purgatory/purgatory.ro'.  Stop.
>   make[3]: *** No rule to make target 'scripts/mod/empty.o', needed by 'scripts/mod/elfconfig.h'.  Stop.
> 
> These are caused by circular dependencies.  The %.o pattern rules in
> scripts/Makefile.build have the stackvalidate binary listed as a
> dependency.  But stackvalidate gets built *after* archprepare and
> scripts/mod, both of which build objects using the %.o pattern rules.
> 
> The STACKVALIDATE and STACKVALIDATE_foo.o variables are already used to
> determine whether to validate a given object.  Also use them to
> determine whether to create the pattern rule dependency.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  scripts/Makefile.build | 7 +++++--
>  scripts/mod/Makefile   | 2 ++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index a1270d3..ec96c51 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -243,7 +243,7 @@ endif
>  
>  ifdef CONFIG_STACK_VALIDATION
>  
> -stackvalidate = $(objtree)/scripts/stackvalidate/stackvalidate
> +__stackvalidate = $(objtree)/scripts/stackvalidate/stackvalidate
>  
>  ifndef CONFIG_FRAME_POINTER
>  nofp = --no-frame-pointer
> @@ -251,9 +251,12 @@ endif
>  
>  # Set STACKVALIDATE_foo.o=n to skip stack validation for a file.
>  # Set STACKVALIDATE=n to skip stack validation for a directory.
> +stackvalidate = $(if $(patsubst n%,, \
> +	$(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \
> +	$(__stackvalidate))
>  cmd_stackvalidate = $(if $(patsubst n%,, \
>  	$(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \
> -	$(stackvalidate) $(nofp) "$(@)";)
> +	$(__stackvalidate) $(nofp) "$(@)";)
>  
>  endif # CONFIG_STACK_VALIDATION
>  
> diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
> index c11212f..374c413 100644
> --- a/scripts/mod/Makefile
> +++ b/scripts/mod/Makefile
> @@ -1,3 +1,5 @@
> +STACKVALIDATE	:= n
> +
>  hostprogs-y	:= modpost mk_elfconfig
>  always		:= $(hostprogs-y) empty.o
>  
> 

Josh,

I still get build failures and I've pared it down to x86_64 defconfig plus:
CONFIG_MODVERSIONS=y
CONFIG_STACK_VALIDATION=y

And it seems like some modules may get the .tmp_foo.o treatment while
others end up foo.o so something like the following will not work:

cmd_stackvalidate = $(if $(patsubst n%,, \
        $(STACKVALIDATE_$(basetarget).o)$(STACKVALIDATE)y), \
        $(__stackvalidate) $(nofp) "$(@D)/.tmp_$(@F)";)

In addition, I'm not sure if skipping modules like STACKVALIDATE_foo.o=n
will still function properly for modversioned modules.

I'll try to look at this more tomorrow,
--chris j arges


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v8 00/21] Compile-time stack validation Chris J Arges <chris.j.arges@canonical.com> - 2015-08-11 23:40 +0200
  Re: [PATCH v8 00/21] Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-12 06:50 +0200
    Re: [PATCH v8 00/21] Compile-time stack validation Chris J Arges <chris.j.arges@canonical.com> - 2015-08-12 23:30 +0200
      Re: [PATCH v8 00/21] Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-13 04:10 +0200
      Re: [PATCH v8 00/21] Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-13 13:30 +0200
        Re: [PATCH v8 00/21] Compile-time stack validation Chris J Arges <chris.j.arges@canonical.com> - 2015-08-13 16:50 +0200
          Re: [PATCH v8 00/21] Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-13 17:00 +0200

csiph-web