linux-kernel.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 v2] pstore/ram: Validate ECC parameters against Reed-Solomon constraint
Date: Mon, 23 Jun 2025 06:51:41 +0000	[thread overview]
Message-ID: <aFj5faLZXnKKtyxA@google.com> (raw)
In-Reply-To: <20250623062827.133373-1-naoyatezuka@chromium.org>

On Mon, Jun 23, 2025 at 03:28:27PM +0900, Naoya Tezuka wrote:
> The Reed-Solomon library enforces the constraint `n <= 2^m - 1` via a
> BUG_ON() [1], where `n` is `block_size + ecc_size` and `m` is `symsize`
> for the pstore RAM backend. A driver providing invalid parameters can
> trigger this, leading to a kernel panic. For more details on the theory
> behind, see [2].
> 
> This issue was discovered during developing chromeos_pstore driver.
> Link: https://lore.kernel.org/lkml/20250610050458.4014083-1-naoyatezuka@chromium.org/

I'd prefer to unify it by using a [3] or at least move the tag to the end of
commit message.

> Add a check to validate this constraint before initializing Reed-Solomon
> codec. On failure, return -EINVAL to prevent the panic.
> 
> [1] https://elixir.bootlin.com/linux/v6.15/source/lib/reed_solomon/decode_rs.c#L43
> [2] https://www.cs.cmu.edu/~guyb/realworld/reedsolomon/reed_solomon_codes.html
> 
> Signed-off-by: Naoya Tezuka <naoyatezuka@chromium.org>

It should preserve my R-b tag as v2 doesn't change too much. Anyway,
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

      reply	other threads:[~2025-06-23  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23  6:28 [PATCH v2] pstore/ram: Validate ECC parameters against Reed-Solomon constraint Naoya Tezuka
2025-06-23  6:51 ` Tzung-Bi Shih [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=aFj5faLZXnKKtyxA@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).