summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/mach-sandbox
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-14 12:05:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-14 15:50:26 +0200
commit5fb2a0e8342424665a01d510ee64d742f586f877 (patch)
treebd8e3174b828f4da1168ac40a1bd10769ab96ffe /arch/sandbox/mach-sandbox
parent2ed55f746c4223b5d7dfcddb2aa3029dc8e7439b (diff)
downloadbarebox-5fb2a0e8342424665a01d510ee64d742f586f877.tar.gz
barebox-5fb2a0e8342424665a01d510ee64d742f586f877.tar.xz
sandbox: add_image: support mmaping block devices on 32-bit hosts
BLKGETSIZE64 writes 64-bit to the address pointed at by the ioctl argument. As hf->size is a 32-bit size_t on 32-bit systems, on such systems, the adjacent member might be corrupted. Fix this. Fixes: 8d6da6462b12 ("sandbox: add_image: mmap block devices") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/mach-sandbox')
-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 54f690be5f..e2f44c4f7b 100644
--- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h
+++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
@@ -4,7 +4,7 @@
struct hf_info {
int fd;
unsigned long long base;
- size_t size;
+ unsigned long long size;
const char *devname;
const char *filename;
};