]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:01 +0000 (00:32 +0100)
commit07489bed80696168a3e43212f63832e55e18b4ae
tree8ceec9124ad5d14348907d5d8d39a21a6385cc43
parentd7aac3477aa40744eb9c101a163a910d4bc7b27a
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>
[bwh: Backported to 3.2: XATTR_BTRFS_PREFIX is not supported]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/btrfs/xattr.c