From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Dominique Martinet <dominique.martinet@atmark-techno.com>,
Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.15 1/3] drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset
Date: Sat, 11 Jan 2025 14:04:50 -0500 [thread overview]
Message-ID: <20250111133306-ee0916fbaee0ad32@stable.kernel.org> (raw)
In-Reply-To: <20250110075844.1173719-2-dominique.martinet@atmark-techno.com>
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 6d2453c3dbc5f70eafc1c866289a90a1fc57ce18
WARNING: Author mismatch between patch and upstream commit:
Backport author: Dominique Martinet<dominique.martinet@atmark-techno.com>
Commit author: Sergey Senozhatsky<senozhatsky@chromium.org>
Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Not found
Note: The patch differs from the upstream commit:
---
1: 6d2453c3dbc5 ! 1: 70169b5d17a5 drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset
@@ Metadata
## Commit message ##
drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset
+ [ Upstream commit 6d2453c3dbc5f70eafc1c866289a90a1fc57ce18 ]
+
We do all reset operations under write lock, so we don't need to save
->disksize and ->comp to stack variables. Another thing is that ->comp is
freed during zram reset, but comp pointer is not NULL-ed, so zram keeps
@@ Commit message
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+ Stable-dep-of: 74363ec674cb ("zram: fix uninitialized ZRAM not releasing backing device")
+ Signed-off-by: Sasha Levin <sashal@kernel.org>
+ Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
## drivers/block/zram/zram_drv.c ##
@@ drivers/block/zram/zram_drv.c: static int zram_rw_page(struct block_device *bdev, sector_t sector,
@@ drivers/block/zram/zram_drv.c: static void zram_reset_device(struct zram *zram)
set_capacity_and_notify(zram->disk, 0);
part_stat_set_all(zram->disk->part0, 0);
+ up_write(&zram->init_lock);
/* I/O operation under all of CPU are done so let's free */
- zram_meta_free(zram, disksize);
+ zram_meta_free(zram, zram->disksize);
@@ drivers/block/zram/zram_drv.c: static void zram_reset_device(struct zram *zram)
+ zcomp_destroy(zram->comp);
+ zram->comp = NULL;
reset_bdev(zram);
+ }
- up_write(&zram->init_lock);
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y | Success | Success |
next prev parent reply other threads:[~2025-01-11 19:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 7:58 [PATCH 5.15 0/3] ZRAM not releasing backing device backport Dominique Martinet
2025-01-10 7:58 ` [PATCH 5.15 1/3] drivers/block/zram/zram_drv.c: do not keep dangling zcomp pointer after zram reset Dominique Martinet
2025-01-11 19:04 ` Sasha Levin [this message]
2025-01-10 7:58 ` [PATCH 5.15 2/3] zram: check comp is non-NULL before calling comp_destroy Dominique Martinet
2025-01-10 22:59 ` kernel test robot
2025-01-11 19:05 ` Sasha Levin
2025-01-10 7:58 ` [PATCH 5.15 3/3] zram: fix uninitialized ZRAM not releasing backing device Dominique Martinet
2025-01-11 19:04 ` Sasha Levin
2025-01-12 10:03 ` [PATCH 5.15 0/3] ZRAM not releasing backing device backport Greg Kroah-Hartman
2025-01-14 7:39 ` Dominique Martinet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250111133306-ee0916fbaee0ad32@stable.kernel.org \
--to=sashal@kernel.org \
--cc=dominique.martinet@atmark-techno.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox