linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Naoya Tezuka <naoyatezuka@chromium.org>
Cc: Kees Cook <kees@kernel.org>, Tony Luck <tony.luck@intel.com>,
	"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pstore/ram: Validate ECC parameters against Reed-Solomon constraint
Date: Mon, 23 Jun 2025 03:03:20 +0000	[thread overview]
Message-ID: <aFjD-D45LkBH_gnA@google.com> (raw)
In-Reply-To: <20250620054757.1006729-1-naoyatezuka@chromium.org>

On Fri, Jun 20, 2025 at 02:47:57PM +0900, Naoya Tezuka wrote:
> The Reed-Solomon library enforces the constraint `n <= 2^m - 1` via a
> BUG_ON(), where `n` is `block_size + ecc_size` and `m` is `symsize` for
  ^^^^^^^^
Better to provide a link, e.g. [1].

[1]: https://elixir.bootlin.com/linux/v6.15/source/lib/reed_solomon/decode_rs.c#L43

> the pstore RAM backend. A driver providing invalid parameters can trigger
> this, leading to a kernel panic. For more details on the theory behind:
> https://www.cs.cmu.edu/~guyb/realworld/reedsolomon/reed_solomon_codes.html
> 
> This issue was discovered during develop chromeos_pstore driver:

s/develop/developing/.

> https://lore.kernel.org/lkml/20250610050458.4014083-1-naoyatezuka@chromium.org/
> 
> Add a check to validate this constraint before initializing Reed-Solomon
> codec. On failure, return -EINVAL to prevent the panic.
> 
> Signed-off-by: Naoya Tezuka <naoyatezuka@chromium.org>

The patch makes sense to me:
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

  reply	other threads:[~2025-06-23  3:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  5:47 [PATCH] pstore/ram: Validate ECC parameters against Reed-Solomon constraint Naoya Tezuka
2025-06-23  3:03 ` Tzung-Bi Shih [this message]
2025-06-23  4:37   ` Naoya Tezuka

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=aFjD-D45LkBH_gnA@google.com \
    --to=tzungbi@kernel.org \
    --cc=gpiccoli@igalia.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naoyatezuka@chromium.org \
    --cc=tony.luck@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).