Commit 10eec60c authored by Scott Bauer's avatar Scott Bauer Committed by Linus Torvalds

vfs: ioctl: prevent double-fetch in dedupe ioctl

This prevents a double-fetch from user space that can lead to to an
undersized allocation and heap overflow.

Fixes: 54dbc151 ("vfs: hoist the btrfs deduplication ioctl to the vfs")
Signed-off-by: default avatarScott Bauer <sbauer@plzdonthack.me>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 884316de
......@@ -590,6 +590,7 @@ static long ioctl_file_dedupe_range(struct file *file, void __user *arg)
goto out;
}
same->dest_count = count;
ret = vfs_dedupe_file_range(file, same);
if (ret)
goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment