ext4: check for NUL characters in extended attribute's name
authorTheodore Ts'o <tytso@mit.edu>
Wed, 1 Aug 2018 16:36:52 +0000 (12:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:18:37 +0000 (09:18 +0200)
commitac92782e4ef6fc9f4694bdc9e1b5d5bfb72027ff
treee539f3163298c0cd6c0a83d939068387327afce2
parentf4d76c934b4dcb6f068d2c850c35ebac5faff021
ext4: check for NUL characters in extended attribute's name

commit 7d95178c77014dbd8dce36ee40bbbc5e6c121ff5 upstream.

Extended attribute names are defined to be NUL-terminated, so the name
must not contain a NUL character.  This is important because there are
places when remove extended attribute, the code uses strlen to
determine the length of the entry.  That should probably be fixed at
some point, but code is currently really messy, so the simplest fix
for now is to simply validate that the extended attributes are sane.

https://bugzilla.kernel.org/show_bug.cgi?id=200401

Reported-by: Wen Xu <wen.xu@gatech.edu>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c