linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris J Arges <chris.j.arges@canonical.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Michal Marek <mmarek@suse.cz>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, Pedro Alves <palves@redhat.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Bernd Petrovitsch <bernd@petrovitsch.priv.at>,
	x86@kernel.org, live-patching@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 00/21] Compile-time stack validation
Date: Thu, 13 Aug 2015 09:42:25 -0500	[thread overview]
Message-ID: <20150813144224.GA9536@canonical.com> (raw)
In-Reply-To: <20150813112220.GA30251@treble.redhat.com>

On Thu, Aug 13, 2015 at 06:22:20AM -0500, Josh Poimboeuf wrote:
> On Wed, Aug 12, 2015 at 04:24:49PM -0500, Chris J Arges wrote:
> > 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)";)
> 
> Does this fix it?
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index ec96c51..0181915 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -263,8 +263,8 @@ endif # CONFIG_STACK_VALIDATION
>  define rule_cc_o_c
>  	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
>  	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
> -	$(cmd_stackvalidate)						  \
>  	$(cmd_modversions)						  \
> +	$(cmd_stackvalidate)						  \
>  	$(call echo-cmd,record_mcount)					  \
>  	$(cmd_record_mcount)						  \
>  	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
>

Josh,

Yes, this fixes my build. For completeness this is my current diff:

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a1270d3..0181915 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,17 +251,20 @@ 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
 
 define rule_cc_o_c
 	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
 	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
-	$(cmd_stackvalidate)						  \
 	$(cmd_modversions)						  \
+	$(cmd_stackvalidate)						  \
 	$(call echo-cmd,record_mcount)					  \
 	$(cmd_record_mcount)						  \
 	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
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

Thanks,
--chris
 

  reply	other threads:[~2015-08-13 14:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 21:31 [PATCH v8 00/21] Compile-time stack validation Chris J Arges
2015-08-12  4:43 ` Josh Poimboeuf
2015-08-12 21:24   ` Chris J Arges
2015-08-13  2:07     ` Josh Poimboeuf
2015-08-13 11:22     ` Josh Poimboeuf
2015-08-13 14:42       ` Chris J Arges [this message]
2015-08-13 14:50         ` Josh Poimboeuf
  -- strict thread matches above, loose matches on Subject: below --
2015-07-28 14:46 Josh Poimboeuf
2015-08-06  8:07 ` Ingo Molnar
2015-08-06 16:06   ` Josh Poimboeuf
2015-08-06 17:23   ` Josh Poimboeuf
2015-08-06 17:46     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150813144224.GA9536@canonical.com \
    --to=chris.j.arges@canonical.com \
    --cc=andi@firstfloor.org \
    --cc=bernd@petrovitsch.priv.at \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mmarek@suse.cz \
    --cc=namhyung@gmail.com \
    --cc=palves@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).