summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/ioctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 26aba0942a98..c415668c86d4 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -582,6 +582,10 @@ static int ioctl_file_dedupe_range(struct file *file, void __user *arg)
}
size = offsetof(struct file_dedupe_range __user, info[count]);
+ if (size > PAGE_SIZE) {
+ ret = -ENOMEM;
+ goto out;
+ }
same = memdup_user(argp, size);
if (IS_ERR(same)) {