Files
kernel_xiaomi_sm8250/fs/jfs
Artem Sadovnikov 4ea25fa874 jfs: xattr: check invalid xattr size more strictly
commit d9f9d96136cba8fedd647d2c024342ce090133c2 upstream.

Commit 7c55b78818cf ("jfs: xattr: fix buffer overflow for invalid xattr")
also addresses this issue but it only fixes it for positive values, while
ea_size is an integer type and can take negative values, e.g. in case of
a corrupted filesystem. This still breaks validation and would overflow
because of implicit conversion from int to size_t in print_hex_dump().

Fix this issue by clamping the ea_size value instead.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Cc: stable@vger.kernel.org
Signed-off-by: Artem Sadovnikov <ancowi69@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-05 10:59:38 +01:00
..
2022-04-15 14:15:04 +02:00
2024-11-08 16:19:12 +01:00
2024-11-08 16:19:21 +01:00
2024-02-23 08:12:44 +01:00