linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix 32-bit linking
@ 2019-06-28 10:39 Arnd Bergmann
  2019-06-28 12:44 ` Christoph Hellwig
  2019-06-28 15:59 ` Jaegeuk Kim
  0 siblings, 2 replies; 10+ messages in thread
From: Arnd Bergmann @ 2019-06-28 10:39 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu
  Cc: Arnd Bergmann, Qiuyang Sun, Sahitya Tummala, Eric Biggers,
	Wang Shilong, linux-f2fs-devel, linux-kernel

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@arndb.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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-01 14:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 10:39 [PATCH] f2fs: fix 32-bit linking Arnd Bergmann
2019-06-28 12:44 ` Christoph Hellwig
2019-06-28 13:09   ` Arnd Bergmann
2019-06-28 13:17     ` Christoph Hellwig
2019-06-28 14:46       ` Arnd Bergmann
2019-06-28 17:58         ` Russell King - ARM Linux admin
2019-07-01 14:58           ` Arnd Bergmann
2019-06-28 23:25   ` Randy Dunlap
2019-06-28 15:59 ` Jaegeuk Kim
2019-07-01 14:54   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).