]> Git Repo - linux.git/commitdiff
vfs: ioctl: prevent double-fetch in dedupe ioctl
authorScott Bauer <[email protected]>
Thu, 28 Jul 2016 01:11:29 +0000 (19:11 -0600)
committerLinus Torvalds <[email protected]>
Thu, 28 Jul 2016 22:23:12 +0000 (15:23 -0700)
This prevents a double-fetch from user space that can lead to to an
undersized allocation and heap overflow.

Fixes: 54dbc1517237 ("vfs: hoist the btrfs deduplication ioctl to the vfs")
Signed-off-by: Scott Bauer <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ioctl.c

index 116a333e9c773c10b76a8030c268284869c2533e..0f56deb24ce6547c1aaa13e6a731779c09047077 100644 (file)
@@ -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;
This page took 0.051249 seconds and 4 git commands to generate.