jffs2: Fix rtime decompressor

BugLink: https://bugs.launchpad.net/bugs/2102118

commit b29bf7119d6bbfd04aabb8d82b060fe2a33ef890 upstream.

The fix for a memory corruption contained a off-by-one error and
caused the compressor to fail in legit cases.

Cc: Kinsey Moore <kinsey.moore@oarcorp.com>
Cc: stable@vger.kernel.org
Fixes: fe051552f5078 ("jffs2: Prevent rtime decompress memory corruption")
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
Richard Weinberger
2025-03-12 22:51:00 +09:00
committed by Stefan Bader
parent 67b2718bd6
commit 1f4c33e179
+1 -1
View File
@@ -95,7 +95,7 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
positions[value]=outpos;
if (repeat) {
if ((outpos + repeat) >= destlen) {
if ((outpos + repeat) > destlen) {
return 1;
}
if (backoffs + repeat >= outpos) {