Jaegeuk Kim ec236cd6a2 f2fs: sanity check of xattr entry size
commit 64beba0558fce7b59e9a8a7afd77290e82a22163 upstream.

There is a security report where f2fs_getxattr() has a hole to expose wrong
memory region when the image is malformed like this.

f2fs_getxattr: entry->e_name_len: 4, size: 12288, buffer_size: 16384, len: 4

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[bwh: Backported to 4.14: Keep using kzalloc()]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:17:03 +02:00
..
2016-09-14 16:52:36 -07:00
2020-01-17 19:45:52 +01:00
2019-12-01 09:13:44 +01:00
2020-01-17 19:45:52 +01:00
2020-02-28 16:36:05 +01:00
2020-05-20 08:17:03 +02:00