summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2020-02-03 09:27:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-10 09:42:43 +0100
commit15395b158eb9f4a2b2aeb7bde97d0d2db99badae (patch)
tree443e341afc04411748647759f7d8504e3f1375cc /arch
parentde0c31a9293adb7518b3b86f12c53c41f8771a28 (diff)
downloadbarebox-15395b158eb9f4a2b2aeb7bde97d0d2db99badae.tar.gz
barebox-15395b158eb9f4a2b2aeb7bde97d0d2db99badae.tar.xz
sandbox: hostfile: fix UB-inducing shift
On 32-bit hosts, UBSan reports: ==================================================================== UBSAN: Undefined behaviour in ./arch/sandbox/board/hostfile.c:135:12 shift exponent 32 is too large for 32-bit type 'long unsigned int' ==================================================================== Fix this by using a unsigned long long for base. The upper 32-bit won't be set, but device tree fixups can now read them. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/sandbox/mach-sandbox/include/mach/hostfile.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sandbox/mach-sandbox/include/mach/hostfile.h b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
index 627fe28e76..54f690be5f 100644
--- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h
+++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
@@ -3,7 +3,7 @@
struct hf_info {
int fd;
- unsigned long base;
+ unsigned long long base;
size_t size;
const char *devname;
const char *filename;