lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190110054216.74248-1-aik@ozlabs.ru>
Date:   Thu, 10 Jan 2019 16:42:16 +1100
From:   Alexey Kardashevskiy <aik@...abs.ru>
To:     linuxppc-dev@...ts.ozlabs.org
Cc:     Alexey Kardashevskiy <aik@...abs.ru>,
        Michael Ellerman <mpe@...erman.id.au>,
        Christophe Leroy <christophe.leroy@....fr>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kernel@...r.kernel.org
Subject: [RFC PATCH kernel] powerpc/stack_protector: Fix external modules building

c3ff2a519 "powerpc/32: add stack protector support" addes stack protector
support so now powerpc's "prepare" target depends on prepare0 (via
stack_protector_prepare target).

It works fine until we try build an external module where it fails with:
Run: 'make -j128 SYSSRC=/home/aik/p/kernel SYSOUT=/home/aik/pbuild/kernel-le-pseries/ ARCH=powerpc'
make[1]: Entering directory '/home/aik/p/kernel'
make[2]: Entering directory '/home/aik/pbuild/kernel-le-pseries'
make[2]: *** No rule to make target 'prepare0', needed by 'stack_protector_prepare'.  Stop.

The reason for that is that the main Linux Makefile defines "prepare0"
only if KBUILD_EXTMOD=="".

This hacks powerpc's Makefile to make external modules build again.

Fixes: c3ff2a519 "powerpc/32: add stack protector support"
Signed-off-by: Alexey Kardashevskiy <aik@...abs.ru>
---


It has been suggested that there is a better way of fixing this hence RFC.


---
 arch/powerpc/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 488c9ed..0492f62 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -419,7 +419,11 @@ archheaders:
 ifdef CONFIG_STACKPROTECTOR
 prepare: stack_protector_prepare
 
+ifeq ($(KBUILD_EXTMOD),)
 stack_protector_prepare: prepare0
+else
+stack_protector_prepare:
+endif
 ifdef CONFIG_PPC64
 	$(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h))
 else
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ