From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Longlong Xia <xialonglong2025@163.com>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Longlong Xia <xialonglong@kylinos.cn>
Subject: Re: [PATCH 0/2] zram: fix stale scan bounds after reinitialization
Date: Wed, 5 Aug 2026 10:42:03 +0900 [thread overview]
Message-ID: <anKUG5B3qfZRVf8n@google.com> (raw)
In-Reply-To: <20260804131046.7c485858542d586bb7c51857@linux-foundation.org>
On (26/08/04 13:10), Andrew Morton wrote:
> On Tue, 4 Aug 2026 14:59:17 +0800 Longlong Xia <xialonglong2025@163.com> wrote:
>
> > Both writeback_store() and read_block_state() derive their table scan
> > bounds from zram->disksize before acquiring dev_lock. If the device is
> > reset and reinitialized with a smaller disksize between that read and lock
> > acquisition, the bound can describe the old table while the scan operates
> > on the new one. This can lead to out-of-bounds slot accesses.
> >
> > Move both bound calculations under dev_lock so each bound remains
> > consistent with the table throughout its scan. Keep the fixes separate
> > because the affected interfaces originate from different commits and can
> > be backported independently.
>
> Thanks. AI review found several things to be worried about, all are
> pre-existing.
>
> https://sashiko.dev/#/patchset/20260804065919.3970386-1-xialonglong2025@163.com
- u32 disksize range check is fixed in a separate Longlong Xia's patch.
- read_block_state() read of zram->disksize outside of device lock
is fixed in this series.
- read_block_state() tear-down is something to look into.
next prev parent reply other threads:[~2026-08-05 1:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 6:59 [PATCH 0/2] zram: fix stale scan bounds after reinitialization Longlong Xia
2026-08-04 6:59 ` [PATCH 1/2] zram: fix out-of-bounds access in writeback_store() Longlong Xia
2026-08-04 8:41 ` Sergey Senozhatsky
2026-08-04 6:59 ` [PATCH 2/2] zram: fix out-of-bounds access in read_block_state() Longlong Xia
2026-08-04 8:42 ` Sergey Senozhatsky
2026-08-04 20:10 ` [PATCH 0/2] zram: fix stale scan bounds after reinitialization Andrew Morton
2026-08-05 1:42 ` Sergey Senozhatsky [this message]
2026-08-05 11:26 ` Sergey Senozhatsky
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=anKUG5B3qfZRVf8n@google.com \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=xialonglong2025@163.com \
--cc=xialonglong@kylinos.cn \
/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