UPSTREAM: ext4: limit xattr size to INT_MAX

commit ce3fd194fcc6fbdc00ce095a852f22df97baa401 upstream.

ext4 isn't validating the sizes of xattrs where the value of the xattr
is stored in an external inode.  This is problematic because
->e_value_size is a u32, but ext4_xattr_get() returns an int.  A very
large size is misinterpreted as an error code, which ext4_get_acl()
translates into a bogus ERR_PTR() for which IS_ERR() returns false,
causing a crash.

Fix this by validating that all xattrs are <= INT_MAX bytes.

This issue has been assigned CVE-2018-1095.

Reported-by: Wen Xu <>
Signed-off-by: Eric Biggers <>
Signed-off-by: Theodore Ts'o <>
Fixes: e50e5129f384 ("ext4: xattr-in-inode support")
Signed-off-by: Greg Kroah-Hartman <>


Change-Id: Icd480c72bb7c6eb2590f60e8660cd3eb1f6d11d6
Signed-off-by: Pradeep Sawlani <>
Reviewed-by: Guenter Roeck <>
1 file changed