The Linux Kernel Mailing List
 help / color / mirror / Atom feed
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 1/2] zram: fix out-of-bounds access in writeback_store()
Date: Tue, 4 Aug 2026 17:41:29 +0900	[thread overview]
Message-ID: <anGlfDQuLZbrXvrn@google.com> (raw)
In-Reply-To: <20260804065919.3970386-2-xialonglong2025@163.com>

On (26/08/04 14:59), Longlong Xia wrote:
> writeback_store() calculates the table scan bounds before taking
> dev_lock. A reset followed by reconfiguration with a smaller disksize
> can therefore replace zram->table while writeback_store() is waiting for
> the lock. Once it acquires the lock, it sees an initialized device but
> scans the new table using the old upper bound, resulting in an
> out-of-bounds access.
> 
> Calculate the number of pages while holding dev_lock so the scan bound
> matches the table protected by the lock.
> 
> Fixes: a939888ec38b ("zram: support idle/huge page writeback")
> 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>

  reply	other threads:[~2026-08-04  8:41 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 [this message]
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
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=anGlfDQuLZbrXvrn@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox