Commit 7d95178c authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: check for NUL characters in extended attribute's name

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. default avatarWen Xu <>
Signed-off-by: default avatarTheodore Ts'o <>
parent 5ef2a699
......@@ -190,6 +190,8 @@ ext4_xattr_check_entries(struct ext4_xattr_entry *entry, void *end,
struct ext4_xattr_entry *next = EXT4_XATTR_NEXT(e);
if ((void *)next >= end)
if (strnlen(e->e_name, e->e_name_len) != e->e_name_len)
e = next;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment