mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
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>
This commit is contained in:
parent
7c8e694bdb
commit
fe051552f5
@ -95,6 +95,9 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
|
||||
|
||||
positions[value]=outpos;
|
||||
if (repeat) {
|
||||
if ((outpos + repeat) >= destlen) {
|
||||
return 1;
|
||||
}
|
||||
if (backoffs + repeat >= outpos) {
|
||||
while(repeat) {
|
||||
cpage_out[outpos++] = cpage_out[backoffs++];
|
||||
|
Loading…
Reference in New Issue
Block a user