jffs2: Prevent rtime decompress memory corruption
authorKinsey Moore <kinsey.moore@oarcorp.com>
Tue, 23 Jul 2024 20:58:05 +0000 (15:58 -0500)
committerRichard Weinberger <richard@nod.at>
Thu, 14 Nov 2024 19:56:19 +0000 (20:56 +0100)
commitfe051552f5078fa02d593847529a3884305a6ffe
tree8b3fc70de308e8cb20923c06eebcc72344033b52
parent7c8e694bdb7ba75d13854b59f3af6d66f0ea6df2
jffs2: Prevent rtime decompress memory corruption

The rtime decompression routine does not fully check bounds during the
entirety of the decompression pass and can corrupt memory outside the
decompression buffer if the compressed data is corrupted. This adds the
required check to prevent this failure mode.

Cc: stable@vger.kernel.org
Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/jffs2/compr_rtime.c