From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Longlong Xia <xialonglong2025@163.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: 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>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] zram: fix out-of-bounds access in read_block_state()
Date: Tue, 4 Aug 2026 17:42:26 +0900 [thread overview]
Message-ID: <anGlv6GhiDL8gQI1@google.com> (raw)
In-Reply-To: <20260804065919.3970386-3-xialonglong2025@163.com>
On (26/08/04 14:59), Longlong Xia wrote:
> read_block_state() calculates nr_pages before taking dev_lock. If the
> device is reset and reinitialized with a smaller disksize before lock
> acquisition, nr_pages still describes the old table. The subsequent
> loop can then call slot_lock() past the end of the newly allocated
> table.
>
> Read disksize after acquiring dev_lock and checking that the device is
> initialized. The read lock then keeps the table and its bound stable for
> the duration of the scan.
>
> Fixes: c0265342bff4 ("zram: introduce zram memory tracking")
> Cc: <stable@vger.kernel.org>
> Assisted-by: Codex:gpt-5.6-sol
> Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
next prev parent reply other threads:[~2026-08-04 8: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 [this message]
2026-08-04 20:10 ` [PATCH 0/2] zram: fix stale scan bounds after reinitialization Andrew Morton
2026-08-05 1:42 ` Sergey Senozhatsky
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=anGlv6GhiDL8gQI1@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=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.