Commit 04678f55 authored by Scott Bauer's avatar Scott Bauer Committed by Greg Kroah-Hartman

vfs: ioctl: prevent double-fetch in dedupe ioctl

commit 10eec60c upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 900ac92c
......@@ -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