btrfs-progs: check link_subvol name base
authorZach Brown <zab@redhat.com>
Mon, 7 Oct 2013 21:42:58 +0000 (14:42 -0700)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:23:13 +0000 (08:23 -0400)
commit538897923e05f9c32e58f41cf023c1da45f0d3ab
tree8413869d761c79e2ff76f83379a466dcfb1704f8
parent69dc09a3ce7e914111c1cf9da93021d9b5d51762
btrfs-progs: check link_subvol name base

In principle, link_subvol() can be given an abitrary string as the name
of the saved subvolume.  It copies it into a fixed-size stack buffer and
then uses it as dirent names without testing its length.

This limits its length to BTRFS_NAME_LEN.  This was found by static
analsys.

Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-convert.c