public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Junrui Luo" <moonafterrain@outlook.com>,
	"Song Liu" <song@kernel.org>,  "Li Nan" <linan122@huawei.com>,
	"Shaohua Li" <shli@fb.com>
Cc: "Song Liu" <songliubraving@fb.com>, <linux-raid@vger.kernel.org>,
	 <linux-kernel@vger.kernel.org>,
	"Yuhao Jiang" <danisjiang@gmail.com>,  <stable@vger.kernel.org>,
	<yukuai@fnnas.com>
Subject: Re: [PATCH] md/raid5: validate payload size before accessing journal metadata
Date: Tue, 7 Apr 2026 13:28:25 +0800	[thread overview]
Message-ID: <558d1df2-7a02-47b7-b1dd-cab4cddd23f4@fnnas.com> (raw)
In-Reply-To: <SYBPR01MB78815E78D829BB86CD7C8015AF5FA@SYBPR01MB7881.ausprd01.prod.outlook.com>

Hi,

在 2026/4/4 15:44, Junrui Luo 写道:
> r5c_recovery_analyze_meta_block() and
> r5l_recovery_verify_data_checksum_for_mb() iterate over payloads in a
> journal metadata block using on-disk payload size fields without
> validating them against the remaining space in the metadata block.
>
> A corrupted journal contains payload sizes extending beyond the PAGE_SIZE
> boundary can cause out-of-bounds reads when accessing payload fields or
> computing offsets.
>
> Add bounds validation for each payload type to ensure the full payload
> fits within meta_size before processing.
>
> Fixes: b4c625c67362 ("md/r5cache: r5cache recovery: part 1")
> Reported-by: Yuhao Jiang<danisjiang@gmail.com>

I didn't found a report mail from patchwork, so I remove this tag

> Cc:stable@vger.kernel.org
> Signed-off-by: Junrui Luo<moonafterrain@outlook.com>
> ---
>   drivers/md/raid5-cache.c | 48 +++++++++++++++++++++++++++++++++---------------
>   1 file changed, 33 insertions(+), 15 deletions(-)
Applied to md-7.1

-- 
Thansk,
Kuai

      reply	other threads:[~2026-04-07  5:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04  7:44 [PATCH] md/raid5: validate payload size before accessing journal metadata Junrui Luo
2026-04-07  5:28 ` Yu Kuai [this message]

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=558d1df2-7a02-47b7-b1dd-cab4cddd23f4@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=danisjiang@gmail.com \
    --cc=linan122@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=moonafterrain@outlook.com \
    --cc=shli@fb.com \
    --cc=song@kernel.org \
    --cc=songliubraving@fb.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