]> git.hungrycats.org Git - linux/commit
btrfs: don't accept bare namespace as a valid xattr
authorDavid Sterba <dsterba@suse.cz>
Wed, 25 Mar 2015 18:26:41 +0000 (19:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:01:40 +0000 (22:01 +0200)
commit1bb2835ed4f8ee186d8110817cf5a96ef9e35ab3
tree02d0afdd63888f70e314af4861bb01530e9bf41a
parent3909e5a93ed64a186a396c1b7fd1db07e065728f
btrfs: don't accept bare namespace as a valid xattr

commit 3c3b04d10ff1811a27f86684ccd2f5ba6983211d upstream.

Due to insufficient check in btrfs_is_valid_xattr, this unexpectedly
works:

 $ touch file
 $ setfattr -n user. -v 1 file
 $ getfattr -d file
user.="1"

ie. the missing attribute name after the namespace.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94291
Reported-by: William Douglas <william.douglas@intel.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/xattr.c