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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -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+=preparearchprepareprepare0prepare1prepare2prepare3+PHONY+=preparearchprepareprepare1prepare2prepare3# prepare3 is used to check if we are building in a separate output directory,# and if so do:
On Tue, 15 Jan 2019 at 08:20, Masahiro Yamada
[off-list ref] 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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
@@ -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+=preparearchprepareprepare0prepare1prepare2prepare3+PHONY+=preparearchprepareprepare1prepare2prepare3# prepare3 is used to check if we are building in a separate output directory,# and if so do:--
On Tue, Jan 15, 2019 at 8:22 AM Masahiro Yamada
[off-list ref] wrote:
quoted hunk
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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -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
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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
Tested-by: Alexey Kardashevskiy <redacted>
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,
@@ -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+=preparearchprepareprepare0prepare1prepare2prepare3+PHONY+=preparearchprepareprepare1prepare2prepare3# prepare3 is used to check if we are building in a separate output directory,# and if so do:
On Tue, Jan 15, 2019 at 7:35 PM Mathieu Malaterre [off-list ref] wrote:
On Tue, Jan 15, 2019 at 8:22 AM Masahiro Yamada
[off-list ref] wrote:
quoted
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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -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?
quoted
-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
On Tue, Jan 15, 2019 at 7:45 PM Alexey Kardashevskiy [off-list ref] wrote:
On 15/01/2019 18:19, Masahiro Yamada wrote:
quoted
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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
Tested-by: Alexey Kardashevskiy <redacted>
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
On Tue, Jan 15, 2019 at 5:07 PM Masahiro Yamada
[off-list ref] 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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
---
@@ -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+=preparearchprepareprepare0prepare1prepare2prepare3+PHONY+=preparearchprepareprepare1prepare2prepare3# prepare3 is used to check if we are building in a separate output directory,# and if so do:--
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2019-01-17 13:39:19
Masahiro Yamada [off-list ref] writes:
On Tue, Jan 15, 2019 at 5:07 PM Masahiro Yamada
[off-list ref] wrote:
quoted
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 <redacted> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <redacted>
Signed-off-by: Masahiro Yamada <redacted>
---