Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;