[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190628104007.2721479-1-arnd@arndb.de>
Date: Fri, 28 Jun 2019 12:39:52 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <yuchao0@...wei.com>
Cc: Arnd Bergmann <arnd@...db.de>, Qiuyang Sun <sunqiuyang@...wei.com>,
Sahitya Tummala <stummala@...eaurora.org>,
Eric Biggers <ebiggers@...gle.com>,
Wang Shilong <wangshilong1991@...il.com>,
linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: [PATCH] f2fs: fix 32-bit linking
Not all architectures support get_user() with a 64-bit argument:
ERROR: "__get_user_bad" [fs/f2fs/f2fs.ko] undefined!
Use copy_from_user() here, this will always work.
Fixes: d2ae7494d043 ("f2fs: ioctl for removing a range from F2FS")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
fs/f2fs/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 998affe31419..465853029b8e 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3066,7 +3066,8 @@ static int f2fs_ioc_resize_fs(struct file *filp, unsigned long arg)
if (f2fs_readonly(sbi->sb))
return -EROFS;
- if (get_user(block_count, (__u64 __user *)arg))
+ if (copy_from_user(&block_count, (void __user *)arg,
+ sizeof(block_count)))
return -EFAULT;
ret = f2fs_resize_fs(sbi, block_count);
--
2.20.0
Powered by blists - more mailing lists