linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
@ 2019-01-15  7:19 Masahiro Yamada
  2019-01-15  8:02 ` Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-01-15  7:19 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ard Biesheuvel, Samuel Holland, Alexey Kardashevskiy,
	linuxppc-dev, Michael Ellerman, Masahiro Yamada,
	linux-stable # v4 . 20, Michal Marek, linux-kernel

Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
caused kernel panic on PowerPC if an external module is used with
CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
for the external module build.

Commit e07db28eea38 ("kbuild: fix single target build for external
module") turned it into a build error because the 'prepare' target is
now executed but the 'prepare0' target is missing for the external
module build.

External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
also broken in the same way.

Move 'PHONY += prepare0' to the common place. Make is fine with missing
rule for phony targets.

I minimize the change so it can be easily backported to 4.20.x

To fix v4.20 for external modules of PowerPC, please backport
e07db28eea38 ("kbuild: fix single target build for external module"),
and then this commit.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
Cc: linux-stable <stable@vger.kernel.org> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 499b968..789b332 100644
--- a/Makefile
+++ b/Makefile
@@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
   endif
 endif
 
+PHONY += prepare0
 
 ifeq ($(KBUILD_EXTMOD),)
 core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
 # archprepare is used in arch Makefiles and when processed asm symlink,
 # version.h and scripts_basic is processed / created.
 
-# Listed in dependency order
-PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
+PHONY += prepare archprepare prepare1 prepare2 prepare3
 
 # prepare3 is used to check if we are building in a separate output directory,
 # and if so do:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15  7:19 [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Masahiro Yamada
@ 2019-01-15  8:02 ` Ard Biesheuvel
  2019-01-15 10:33 ` Mathieu Malaterre
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2019-01-15  8:02 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Samuel Holland, Alexey Kardashevskiy,
	linuxppc-dev, Michael Ellerman, linux-stable # v4 . 20,
	Michal Marek, Linux Kernel Mailing List

On Tue, 15 Jan 2019 at 08:20, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> caused kernel panic on PowerPC if an external module is used with
> CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> for the external module build.
>
> Commit e07db28eea38 ("kbuild: fix single target build for external
> module") turned it into a build error because the 'prepare' target is
> now executed but the 'prepare0' target is missing for the external
> module build.
>
> External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> also broken in the same way.
>
> Move 'PHONY += prepare0' to the common place. Make is fine with missing
> rule for phony targets.
>
> I minimize the change so it can be easily backported to 4.20.x
>
> To fix v4.20 for external modules of PowerPC, please backport
> e07db28eea38 ("kbuild: fix single target build for external module"),
> and then this commit.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> Cc: linux-stable <stable@vger.kernel.org> # v4.20
> Reported-by: Samuel Holland <samuel@sholland.org>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 499b968..789b332 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
>    endif
>  endif
>
> +PHONY += prepare0
>
>  ifeq ($(KBUILD_EXTMOD),)
>  core-y         += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
>  # archprepare is used in arch Makefiles and when processed asm symlink,
>  # version.h and scripts_basic is processed / created.
>
> -# Listed in dependency order
> -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
> +PHONY += prepare archprepare prepare1 prepare2 prepare3
>
>  # prepare3 is used to check if we are building in a separate output directory,
>  # and if so do:
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15  7:19 [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Masahiro Yamada
  2019-01-15  8:02 ` Ard Biesheuvel
@ 2019-01-15 10:33 ` Mathieu Malaterre
  2019-01-15 14:58   ` Masahiro Yamada
  2019-01-15 10:44 ` Alexey Kardashevskiy
  2019-01-16 14:33 ` Masahiro Yamada
  3 siblings, 1 reply; 8+ messages in thread
From: Mathieu Malaterre @ 2019-01-15 10:33 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Michal Marek, Samuel Holland, Alexey Kardashevskiy,
	Ard Biesheuvel, LKML, linux-stable # v4 . 20, linuxppc-dev

On Tue, Jan 15, 2019 at 8:22 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> caused kernel panic on PowerPC if an external module is used with
> CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> for the external module build.
>
> Commit e07db28eea38 ("kbuild: fix single target build for external
> module") turned it into a build error because the 'prepare' target is
> now executed but the 'prepare0' target is missing for the external
> module build.
>
> External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> also broken in the same way.
>
> Move 'PHONY += prepare0' to the common place. Make is fine with missing
> rule for phony targets.
>
> I minimize the change so it can be easily backported to 4.20.x
>
> To fix v4.20 for external modules of PowerPC, please backport
> e07db28eea38 ("kbuild: fix single target build for external module"),
> and then this commit.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> Cc: linux-stable <stable@vger.kernel.org> # v4.20
> Reported-by: Samuel Holland <samuel@sholland.org>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 499b968..789b332 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
>    endif
>  endif
>
> +PHONY += prepare0
>
>  ifeq ($(KBUILD_EXTMOD),)
>  core-y         += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
>  # archprepare is used in arch Makefiles and when processed asm symlink,
>  # version.h and scripts_basic is processed / created.
>
> -# Listed in dependency order

The above comment may need to be tweaked a bit

> -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
> +PHONY += prepare archprepare prepare1 prepare2 prepare3
>
>  # prepare3 is used to check if we are building in a separate output directory,
>  # and if so do:
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15  7:19 [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Masahiro Yamada
  2019-01-15  8:02 ` Ard Biesheuvel
  2019-01-15 10:33 ` Mathieu Malaterre
@ 2019-01-15 10:44 ` Alexey Kardashevskiy
  2019-01-15 15:01   ` Masahiro Yamada
  2019-01-16 14:33 ` Masahiro Yamada
  3 siblings, 1 reply; 8+ messages in thread
From: Alexey Kardashevskiy @ 2019-01-15 10:44 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Ard Biesheuvel, Samuel Holland, linuxppc-dev, Michael Ellerman,
	linux-stable # v4 . 20, Michal Marek, linux-kernel



On 15/01/2019 18:19, Masahiro Yamada wrote:
> Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> caused kernel panic on PowerPC if an external module is used with
> CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> for the external module build.
> 
> Commit e07db28eea38 ("kbuild: fix single target build for external
> module") turned it into a build error because the 'prepare' target is
> now executed but the 'prepare0' target is missing for the external
> module build.
> 
> External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> also broken in the same way.
> 
> Move 'PHONY += prepare0' to the common place. Make is fine with missing
> rule for phony targets.
> 
> I minimize the change so it can be easily backported to 4.20.x
> 
> To fix v4.20 for external modules of PowerPC, please backport
> e07db28eea38 ("kbuild: fix single target build for external module"),
> and then this commit.
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> Cc: linux-stable <stable@vger.kernel.org> # v4.20
> Reported-by: Samuel Holland <samuel@sholland.org>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Thanks for fixing this! Out of curiosity - how does this work?
arch/powerpc/Makefile's stack_protector_prepare still depends on
prepare0 which is still defined only if KBUILD_EXTMOD=="" but somehow it
does not bother ./Makefile? Thanks,


> ---
> 
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 499b968..789b332 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
>    endif
>  endif
>  
> +PHONY += prepare0
>  
>  ifeq ($(KBUILD_EXTMOD),)
>  core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
>  # archprepare is used in arch Makefiles and when processed asm symlink,
>  # version.h and scripts_basic is processed / created.
>  
> -# Listed in dependency order
> -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
> +PHONY += prepare archprepare prepare1 prepare2 prepare3
>  
>  # prepare3 is used to check if we are building in a separate output directory,
>  # and if so do:
> 

-- 
Alexey

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15 10:33 ` Mathieu Malaterre
@ 2019-01-15 14:58   ` Masahiro Yamada
  0 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-01-15 14:58 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: linux-kbuild, Michal Marek, Samuel Holland, Alexey Kardashevskiy,
	Ard Biesheuvel, LKML, linux-stable # v4 . 20, linuxppc-dev

On Tue, Jan 15, 2019 at 7:35 PM Mathieu Malaterre <malat@debian.org> wrote:
>
> On Tue, Jan 15, 2019 at 8:22 AM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> > caused kernel panic on PowerPC if an external module is used with
> > CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> > for the external module build.
> >
> > Commit e07db28eea38 ("kbuild: fix single target build for external
> > module") turned it into a build error because the 'prepare' target is
> > now executed but the 'prepare0' target is missing for the external
> > module build.
> >
> > External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> > also broken in the same way.
> >
> > Move 'PHONY += prepare0' to the common place. Make is fine with missing
> > rule for phony targets.
> >
> > I minimize the change so it can be easily backported to 4.20.x
> >
> > To fix v4.20 for external modules of PowerPC, please backport
> > e07db28eea38 ("kbuild: fix single target build for external module"),
> > and then this commit.
> >
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> > Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> > Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> > Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> > Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> > Cc: linux-stable <stable@vger.kernel.org> # v4.20
> > Reported-by: Samuel Holland <samuel@sholland.org>
> > Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  Makefile | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 499b968..789b332 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
> >    endif
> >  endif
> >
> > +PHONY += prepare0
> >
> >  ifeq ($(KBUILD_EXTMOD),)
> >  core-y         += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> > @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
> >  # archprepare is used in arch Makefiles and when processed asm symlink,
> >  # version.h and scripts_basic is processed / created.
> >
> > -# Listed in dependency order
>
> The above comment may need to be tweaked a bit

The comment is wrong irrespective of this patch,
and less important.

Do you have any suggestion how to tweak it?


> > -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
> > +PHONY += prepare archprepare prepare1 prepare2 prepare3
> >
> >  # prepare3 is used to check if we are building in a separate output directory,
> >  # and if so do:
> > --
> > 2.7.4
> >



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15 10:44 ` Alexey Kardashevskiy
@ 2019-01-15 15:01   ` Masahiro Yamada
  0 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-01-15 15:01 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: Linux Kbuild mailing list, Ard Biesheuvel, Samuel Holland,
	linuxppc-dev, Michael Ellerman, linux-stable # v4 . 20,
	Michal Marek, Linux Kernel Mailing List

On Tue, Jan 15, 2019 at 7:45 PM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
>
>
> On 15/01/2019 18:19, Masahiro Yamada wrote:
> > Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> > caused kernel panic on PowerPC if an external module is used with
> > CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> > for the external module build.
> >
> > Commit e07db28eea38 ("kbuild: fix single target build for external
> > module") turned it into a build error because the 'prepare' target is
> > now executed but the 'prepare0' target is missing for the external
> > module build.
> >
> > External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> > also broken in the same way.
> >
> > Move 'PHONY += prepare0' to the common place. Make is fine with missing
> > rule for phony targets.
> >
> > I minimize the change so it can be easily backported to 4.20.x
> >
> > To fix v4.20 for external modules of PowerPC, please backport
> > e07db28eea38 ("kbuild: fix single target build for external module"),
> > and then this commit.
> >
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> > Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> > Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> > Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> > Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> > Cc: linux-stable <stable@vger.kernel.org> # v4.20
> > Reported-by: Samuel Holland <samuel@sholland.org>
> > Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
>
> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> Thanks for fixing this! Out of curiosity - how does this work?
> arch/powerpc/Makefile's stack_protector_prepare still depends on
> prepare0 which is still defined only if KBUILD_EXTMOD=="" but somehow it
> does not bother ./Makefile? Thanks,


Missing phony targets are ignored.


I do not know if it is officially documented,
but GNU Make works like that.

Is the following test code helpful?


[Test Makefile]

prepare: prepare0
        @echo hello world

.PHONY: prepare prepare0


[Result]
$ make
hello world



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-15  7:19 [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Masahiro Yamada
                   ` (2 preceding siblings ...)
  2019-01-15 10:44 ` Alexey Kardashevskiy
@ 2019-01-16 14:33 ` Masahiro Yamada
  2019-01-17 13:39   ` Michael Ellerman
  3 siblings, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-01-16 14:33 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Ard Biesheuvel, Samuel Holland, Alexey Kardashevskiy,
	linuxppc-dev, Michael Ellerman, linux-stable # v4 . 20,
	Michal Marek, Linux Kernel Mailing List

On Tue, Jan 15, 2019 at 5:07 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
> caused kernel panic on PowerPC if an external module is used with
> CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
> for the external module build.
>
> Commit e07db28eea38 ("kbuild: fix single target build for external
> module") turned it into a build error because the 'prepare' target is
> now executed but the 'prepare0' target is missing for the external
> module build.
>
> External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
> also broken in the same way.
>
> Move 'PHONY += prepare0' to the common place. Make is fine with missing
> rule for phony targets.
>
> I minimize the change so it can be easily backported to 4.20.x
>
> To fix v4.20 for external modules of PowerPC, please backport
> e07db28eea38 ("kbuild: fix single target build for external module"),
> and then this commit.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
> Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
> Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
> Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
> Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
> Cc: linux-stable <stable@vger.kernel.org> # v4.20
> Reported-by: Samuel Holland <samuel@sholland.org>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to linux-kbuild/fixes.


>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 499b968..789b332 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION
>    endif
>  endif
>
> +PHONY += prepare0
>
>  ifeq ($(KBUILD_EXTMOD),)
>  core-y         += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> @@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc
>  # archprepare is used in arch Makefiles and when processed asm symlink,
>  # version.h and scripts_basic is processed / created.
>
> -# Listed in dependency order
> -PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
> +PHONY += prepare archprepare prepare1 prepare2 prepare3
>
>  # prepare3 is used to check if we are building in a separate output directory,
>  # and if so do:
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kbuild: mark prepare0 as PHONY to fix external module build
  2019-01-16 14:33 ` Masahiro Yamada
@ 2019-01-17 13:39   ` Michael Ellerman
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2019-01-17 13:39 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list
  Cc: Ard Biesheuvel, Samuel Holland, Alexey Kardashevskiy,
	linuxppc-dev, linux-stable # v4 . 20, Michal Marek,
	Linux Kernel Mailing List

Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> On Tue, Jan 15, 2019 at 5:07 PM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>>
>> Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
>> caused kernel panic on PowerPC if an external module is used with
>> CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
>> for the external module build.
>>
>> Commit e07db28eea38 ("kbuild: fix single target build for external
>> module") turned it into a build error because the 'prepare' target is
>> now executed but the 'prepare0' target is missing for the external
>> module build.
>>
>> External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
>> also broken in the same way.
>>
>> Move 'PHONY += prepare0' to the common place. Make is fine with missing
>> rule for phony targets.
>>
>> I minimize the change so it can be easily backported to 4.20.x
>>
>> To fix v4.20 for external modules of PowerPC, please backport
>> e07db28eea38 ("kbuild: fix single target build for external module"),
>> and then this commit.
>>
>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
>> Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
>> Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
>> Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
>> Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
>> Cc: linux-stable <stable@vger.kernel.org> # v4.20
>> Reported-by: Samuel Holland <samuel@sholland.org>
>> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>
> Applied to linux-kbuild/fixes.

Thanks.

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-17 13:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15  7:19 [PATCH] kbuild: mark prepare0 as PHONY to fix external module build Masahiro Yamada
2019-01-15  8:02 ` Ard Biesheuvel
2019-01-15 10:33 ` Mathieu Malaterre
2019-01-15 14:58   ` Masahiro Yamada
2019-01-15 10:44 ` Alexey Kardashevskiy
2019-01-15 15:01   ` Masahiro Yamada
2019-01-16 14:33 ` Masahiro Yamada
2019-01-17 13:39   ` Michael Ellerman

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).