From: Greg Kroah-Hartman Date: Thu, 9 Jan 2025 10:11:00 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v5.4.289~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93c6237a5f22f4799e6d7e271ab4d8f07f40582a;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: zram-check-comp-is-non-null-before-calling-comp_destroy.patch --- diff --git a/queue-6.1/series b/queue-6.1/series index e15101b4bd1..abe5c35403d 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -79,3 +79,4 @@ mm-vmscan-account-for-free-pages-to-prevent-infinite-loop-in-throttle_direct_rec mptcp-fix-tcp-options-overflow.patch mptcp-fix-recvbuffer-adjust-on-sleeping-rcvmsg.patch mptcp-don-t-always-assume-copied-data-in-mptcp_cleanup_rbuf.patch +zram-check-comp-is-non-null-before-calling-comp_destroy.patch diff --git a/queue-6.1/zram-check-comp-is-non-null-before-calling-comp_destroy.patch b/queue-6.1/zram-check-comp-is-non-null-before-calling-comp_destroy.patch new file mode 100644 index 00000000000..255983cb3d1 --- /dev/null +++ b/queue-6.1/zram-check-comp-is-non-null-before-calling-comp_destroy.patch @@ -0,0 +1,39 @@ +From dominique.martinet@atmark-techno.com Thu Jan 9 11:09:53 2025 +From: Dominique Martinet +Date: Tue, 7 Jan 2025 16:16:04 +0900 +Subject: zram: check comp is non-NULL before calling comp_destroy +To: Greg Kroah-Hartman +Cc: stable@vger.kernel.org, patches@lists.linux.dev, Kairui Song , Desheng Wu , Sergey Senozhatsky , Andrew Morton , Sasha Levin , Dominique Martinet +Message-ID: <20250107071604.190497-1-dominique.martinet@atmark-techno.com> + +From: Dominique Martinet + +This is a pre-requisite for the backport of commit 74363ec674cb ("zram: +fix uninitialized ZRAM not releasing backing device"), which has been +implemented differently in commit 7ac07a26dea7 ("zram: preparation for +multi-zcomp support") upstream. + +We only need to ensure that zcomp_destroy is not called with a NULL +comp, so add this check as the other commit cannot be backported easily. + +Stable-dep-of: 74363ec674cb ("zram: fix uninitialized ZRAM not releasing backing device") +Link: https://lore.kernel.org/Z3ytcILx4S1v_ueJ@codewreck.org +Suggested-by: Kairui Song +Signed-off-by: Dominique Martinet +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/zram/zram_drv.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -1733,7 +1733,8 @@ static void zram_reset_device(struct zra + zram_meta_free(zram, zram->disksize); + zram->disksize = 0; + memset(&zram->stats, 0, sizeof(zram->stats)); +- zcomp_destroy(zram->comp); ++ if (zram->comp) ++ zcomp_destroy(zram->comp); + zram->comp = NULL; + reset_bdev(zram); +