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: <CAB=NE6Xu2t7JYUfvZcPSpX_Yt2yN9ooWgzctZFMr3LZGG1hVzw@mail.gmail.com>
Date:	Tue, 2 Aug 2016 14:14:22 -0700
From:	"Luis R. Rodriguez" <mcgrof@...not-panic.com>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Michael Ellerman <mpe@...erman.id.au>
Cc:	linuxppc-dev@...ts.ozlabs.org,
	Fengguang Wu <fengguang.wu@...el.com>,
	Guenter Roeck <linux@...ck-us.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: linker tables on powerpc - build issues

I've run into a few compilation issues with linker tables support [0]
[1] on only a few architectures:

blackfin - compiler issue it seems, I have a work around now in place
arm  - some alignment issue - still need to iron this out
powerpc - issue with including <asm/sections.h> on <asm/jump_labels.h>

The issue with powerpc can be replicated easily with the patch below,
and compilation fails even on a 'make defconfig' configuration, the
issues are recurring include header ordering issues. I've given this
some tries to fix but am still a bit bewildered how to best do this
without affecting non-powerpc compilations.  The patch below
replicates the changes in question, it does not include the linker
table work at all, it just includes <asm/sections.h> instead of
<asm/tables.h> to reduce and provide an example of the issues
observed. The list of errors are also pretty endless... so was hoping
some power folks might be able to take a glance if possible. If you
have any ideas, please let me know.

[0] https://lkml.kernel.org/r/1469222687-1600-1-git-send-email-mcgrof@kernel.org
[1] https://git.kernel.org/cgit/linux/kernel/git/mcgrof/linux-next.git/log/?h=20160729-linker-table-v4-blackfin2

diff --git a/arch/powerpc/include/asm/jump_label.h
b/arch/powerpc/include/asm/jump_label.h
index 9a287e0ac8b1..68e46825b0f8 100644
--- a/arch/powerpc/include/asm/jump_label.h
+++ b/arch/powerpc/include/asm/jump_label.h
@@ -9,6 +9,7 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+#include <asm/sections.h>

 #ifndef __ASSEMBLY__
 #include <linux/types.h>
diff --git a/arch/powerpc/include/asm/sections.h
b/arch/powerpc/include/asm/sections.h
index 7dc006b58369..929decb62d9c 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -1,11 +1,14 @@
 #ifndef _ASM_POWERPC_SECTIONS_H
 #define _ASM_POWERPC_SECTIONS_H
-#ifdef __KERNEL__

+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
 #include <linux/elf.h>
 #include <linux/uaccess.h>
+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__) */
+
 #include <asm-generic/sections.h>

+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
 #ifdef __powerpc64__

 extern char __start_interrupts[];
@@ -77,5 +80,5 @@ static inline void *dereference_function_descriptor(void *ptr)

 #endif

-#endif /* __KERNEL__ */
+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__) */
 #endif /* _ASM_POWERPC_SECTIONS_H */
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index af0254c09424..06bceee909da 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_GENERIC_SECTIONS_H_
 #define _ASM_GENERIC_SECTIONS_H_

+#if defined(__KERNEL__) && !defined(__ASSEMBLER__) && !defined(__ASSEMBLY__)
+
 /* References to section boundaries */

 #include <linux/compiler.h>
@@ -128,4 +130,6 @@ static inline bool init_section_intersects(void
*virt, size_t size)
  return memory_intersects(__init_begin, __init_end, virt, size);
 }

+#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) &&
!defined(__ASSEMBLY__)  */
+
 #endif /* _ASM_GENERIC_SECTIONS_H_ */


  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ