Patch "erofs: fix memory leak of LZMA global compressed deduplication" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    erofs: fix memory leak of LZMA global compressed deduplication

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-fix-memory-leak-of-lzma-global-compressed-dedu.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f3db9a070ca35d59630002ea2b49bd7db5b86fe7
Author: Gao Xiang <xiang@xxxxxxxxxx>
Date:   Thu Sep 7 13:05:42 2023 +0800

    erofs: fix memory leak of LZMA global compressed deduplication
    
    [ Upstream commit 75a5221630fe5aa3fedba7a06be618db0f79ba1e ]
    
    When stressing microLZMA EROFS images with the new global compressed
    deduplication feature enabled (`-Ededupe`), I found some short-lived
    temporary pages weren't properly released, which could slowly cause
    unexpected OOMs hours later.
    
    Let's fix it now (LZ4 and DEFLATE don't have this issue.)
    
    Fixes: 5c2a64252c5d ("erofs: introduce partial-referenced pclusters")
    Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230907050542.97152-1-hsiangkao@xxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c
index 5cd612a8f8584..49addc345aebe 100644
--- a/fs/erofs/decompressor_lzma.c
+++ b/fs/erofs/decompressor_lzma.c
@@ -217,9 +217,12 @@ int z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq,
 			strm->buf.out_size = min_t(u32, outlen,
 						   PAGE_SIZE - pageofs);
 			outlen -= strm->buf.out_size;
-			if (!rq->out[no] && rq->fillgaps)	/* deduped */
+			if (!rq->out[no] && rq->fillgaps) {	/* deduped */
 				rq->out[no] = erofs_allocpage(pagepool,
 						GFP_KERNEL | __GFP_NOFAIL);
+				set_page_private(rq->out[no],
+						 Z_EROFS_SHORTLIVED_PAGE);
+			}
 			if (rq->out[no])
 				strm->buf.out = kmap(rq->out[no]) + pageofs;
 			pageofs = 0;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux