Fix for CVE-2019-1999 not publicly available yet
ext4: add corruption check in ext4_xattr_set_entry()

commit 5369a762c882c0b6e9599e4ebbb3a9ba9eee7e2d upstream.

In theory this should have been caught earlier when the xattr list was
verified, but in case it got missed, it's simple enough to add check
to make sure we don't overrun the xattr buffer.

This addresses CVE-2018-10879.

Signed-off-by: Theodore Ts'o <>
Reviewed-by: Andreas Dilger <>
[bwh: Backported to 3.16:
 - Add inode parameter to ext4_xattr_set_entry() and update callers
 - Adjust context]
Signed-off-by: Ben Hutchings <>
[adjusted for 4.4 context]
Signed-off-by: Daniel Rosenberg <>
Signed-off-by: Greg Kroah-Hartman <>
1 file changed