]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: limit xattr size to INT_MAX
authorEric Biggers <ebiggers@google.com>
Thu, 29 Mar 2018 18:31:42 +0000 (14:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 29 Mar 2018 18:31:42 +0000 (14:31 -0400)
commit8f8fe6d9189dd8b6d7d5a30a177719e4c9a85789
tree253d8a212f3e27bf2fc56e8176a4b44f8e15c944
parentc6c79670880cb4d8e58f9bdc18005eef781a8315
ext4: limit xattr size to INT_MAX

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.

https://bugzilla.kernel.org/show_bug.cgi?id=199185
https://bugzilla.redhat.com/show_bug.cgi?id=1560793

Reported-by: Wen Xu <wen.xu@gatech.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Fixes: eb5d8ee3ee9b ("ext4: xattr-in-inode support")
fs/ext4/xattr.c