Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: ignore e_value_offs for xattrs with value-in-ea-inode

In other places in fs/ext4/xattr.c, if e_value_inum is non-zero, the
code ignores the value in e_value_offs. The e_value_offs *should* be
zero, but we shouldn't depend upon it, since it might not be true in a
corrupted/fuzzed file system.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202897
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202877
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org

+1 -1
+1 -1
fs/ext4/xattr.c
··· 1696 1696 1697 1697 /* No failures allowed past this point. */ 1698 1698 1699 - if (!s->not_found && here->e_value_size && here->e_value_offs) { 1699 + if (!s->not_found && here->e_value_size && !here->e_value_inum) { 1700 1700 /* Remove the old value. */ 1701 1701 void *first_val = s->base + min_offs; 1702 1702 size_t offs = le16_to_cpu(here->e_value_offs);