public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] locking/qrwlock: include asm/byteorder.h as needed
@ 2018-02-02 15:40 Arnd Bergmann
  2018-02-02 15:40 ` [PATCH 2/2] Kbuild: always define endianess in kconfig.h Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2018-02-02 15:40 UTC (permalink / raw)
  To: Andrew Morton, Arnd Bergmann
  Cc: Nicolas Pitre, Andi Kleen, Babu Moger, Will Deacon, stable,
	Peter Zijlstra, Ingo Molnar, Thomas Gleixner, Greg Kroah-Hartman,
	linux-arch, linux-kernel

Moving the qrwlock struct definition into a header file introduced
a subtle bug on all little-endian machines, where some files in some
configurations would see the fields in an incorrect order.  This was
found by building with an LTO enabled compiler that warns every time we
try to link together files with incompatible data structures.

A second patch changes linux/kconfig.h to always define the symbols,
but this seems to be the root cause of most of the issues, so I'd suggest
we do both.

On a current linux-next kernel, I verified that this header is
responsible for all type mismatches as a result from the endianess
confusion.

Cc: stable@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: e0d02285f16e ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/qrwlock_types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h
index 137ecdd16daa..c36f1d5a2572 100644
--- a/include/asm-generic/qrwlock_types.h
+++ b/include/asm-generic/qrwlock_types.h
@@ -3,6 +3,7 @@
 #define __ASM_GENERIC_QRWLOCK_TYPES_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 #include <asm/spinlock_types.h>
 
 /*
-- 
2.9.0

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

end of thread, other threads:[~2018-02-02 19:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-02 15:40 [PATCH 1/2] locking/qrwlock: include asm/byteorder.h as needed Arnd Bergmann
2018-02-02 15:40 ` [PATCH 2/2] Kbuild: always define endianess in kconfig.h Arnd Bergmann
2018-02-02 16:31   ` Masahiro Yamada
2018-02-02 16:44     ` Arnd Bergmann
2018-02-02 19:49   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox