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>] [day] [month] [year] [list]
Message-Id: <20251108-mips-bpf-fix-v1-1-0467c3ee2613@mainlining.org>
Date: Sat, 08 Nov 2025 23:05:55 +0100
From: Jens Reidel <adrian@...nlining.org>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
 Nathan Chancellor <nathan@...nel.org>, 
 Nick Desaulniers <nick.desaulniers+lkml@...il.com>, 
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org, 
 bpf@...r.kernel.org, llvm@...ts.linux.dev, 
 Jens Reidel <adrian@...nlining.org>
Subject: [PATCH] mips: Use generic endianness macros instead of
 MIPS-specific ones

Compiling bpf_skel for mips currently fails because clang --target=bpf
is invoked and the source files include byteorder.h, which uses the
MIPS-specific macros to determine the endianness, rather than the generic
__LITTLE_ENDIAN__ / __BIG_ENDIAN__. Fix this by using the generic
macros, which are also defined when targeting bpf. This is already done
similarly for powerpc.

Signed-off-by: Jens Reidel <adrian@...nlining.org>
---
 arch/mips/include/uapi/asm/byteorder.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/include/uapi/asm/byteorder.h b/arch/mips/include/uapi/asm/byteorder.h
index b4edc85f9c30c09aafbc189ec820e6e2f7cbe0d8..5e3c3baa24994a9f3637bf2b63ea7c3577cae541 100644
--- a/arch/mips/include/uapi/asm/byteorder.h
+++ b/arch/mips/include/uapi/asm/byteorder.h
@@ -9,12 +9,10 @@
 #ifndef _ASM_BYTEORDER_H
 #define _ASM_BYTEORDER_H
 
-#if defined(__MIPSEB__)
-#include <linux/byteorder/big_endian.h>
-#elif defined(__MIPSEL__)
+#ifdef __LITTLE_ENDIAN__
 #include <linux/byteorder/little_endian.h>
 #else
-# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
+#include <linux/byteorder/big_endian.h>
 #endif
 
 #endif /* _ASM_BYTEORDER_H */

---
base-commit: 9c0826a5d9aa4d52206dd89976858457a2a8a7ed
change-id: 20251108-mips-bpf-fix-8d1f14bc4903

Best regards,
-- 
Jens Reidel <adrian@...nlining.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ