diff mbox series

hostfs: fix 32-bit crash

Message ID 20240702004717.463818729615.Id0767e12f562a69c6cd3c3262dc3d765db350cf6@changeid
State Changes Requested
Headers show
Series hostfs: fix 32-bit crash | expand

Commit Message

Johannes Berg July 1, 2024, 10:47 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

dev_t is a kernel type and may have different definitions
in kernel and userspace. On 32-bit x86 this currently makes
the stat structure being 4 bytes longer in the user code,
causing stack corruption. Just use 'unsigned int' so the
same size is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 fs/hostfs/hostfs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
index 0239e3af3945..89217d1a2189 100644
--- a/fs/hostfs/hostfs.h
+++ b/fs/hostfs/hostfs.h
@@ -65,7 +65,7 @@  struct hostfs_stat {
 	unsigned long long blocks;
 	unsigned int maj;
 	unsigned int min;
-	dev_t dev;
+	unsigned int dev;
 };
 
 extern int stat_file(const char *path, struct hostfs_stat *p, int fd);