diff options
author | David Sterba <dsterba@suse.com> | 2015-10-12 16:55:54 +0200 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-13 18:53:03 -0700 |
commit | 8eb934591f8bf584969454a658f629cd06e59f3a (patch) | |
tree | 5963f95a1602c250d681d4222eccbd442313381b /fs/btrfs/ioctl.c | |
parent | 7d35199e15b82a4d1a20049153b03e6258ce79f7 (diff) | |
download | op-kernel-dev-8eb934591f8bf584969454a658f629cd06e59f3a.zip op-kernel-dev-8eb934591f8bf584969454a658f629cd06e59f3a.tar.gz |
btrfs: check unsupported filters in balance arguments
We don't verify that all the balance filter arguments supplemented by
the flags are actually known to the kernel. Thus we let it silently pass
and do nothing.
At the moment this means only the 'limit' filter, but we're going to add
a few more soon so it's better to have that fixed. Also in older stable
kernels so that it works with newer userspace tools.
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0adf542..3e3e613 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4639,6 +4639,11 @@ locked: bctl->flags |= BTRFS_BALANCE_TYPE_MASK; } + if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) { + ret = -EINVAL; + goto out_bargs; + } + do_balance: /* * Ownership of bctl and mutually_exclusive_operation_running |