aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorGravatar David Sterba <dsterba@suse.com> 2024-02-14 10:54:31 +0100
committerGravatar David Sterba <dsterba@suse.com> 2024-03-04 16:24:52 +0100
commit0478adff0fae7555c10787470ae04390a8b45e12 (patch)
treeb88ef215b68c880269850350f14d4e2d16b744ae /fs/btrfs/send.c
parentbtrfs: factor out validation of btrfs_ioctl_vol_args::name (diff)
downloadlinux-0478adff0fae7555c10787470ae04390a8b45e12.tar.gz
linux-0478adff0fae7555c10787470ae04390a8b45e12.tar.bz2
linux-0478adff0fae7555c10787470ae04390a8b45e12.zip
btrfs: factor out validation of btrfs_ioctl_vol_args_v2::name
The validation of vol args v2 name in snapshot and device remove ioctls is not done properly. A terminating NUL is written to the end of the buffer unconditionally, assuming that this would be the last place in case the buffer is used completely. This does not communicate back the actual error (either an invalid or too long path). Factor out all such cases and use a helper to do the verification, simply look for NUL in the buffer. There's no expected practical change, the size of buffer is 4088, this is enough for most paths or names. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/send.c')
0 files changed, 0 insertions, 0 deletions