mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryam Vargas <hexlabsecurity@proton.me>
To: Ming-Hung Tsai <mtsai@redhat.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	Alasdair Kergon <agk@redhat.com>, Joe Thornber <ejt@redhat.com>,
	dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] dm array: validate array block headers on read
Date: Sat, 08 Aug 2026 08:59:49 +0000	[thread overview]
Message-ID: <20260808085943.422108-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <CALjSBEvVOTpd+j3zgspvdbX2fhQwc1HoNQHFup0uEfkRM=2kVQ@mail.gmail.com>

On Mon, Aug 03, 2026 at 09:41:36PM +0800, Ming-Hung Tsai wrote:
> One minor nit, which needn't hold up the patch: I'd drop "wanted %u"
> from the error message. The wanted value is derivable from value_size,
> so printing "%s failed: max_entries %u invalid for value_size %u"
> carries the same information.

I'd keep it. The two DMERR_LIMITs above it in array_block_check() are
"blocknr %llu != wanted %llu" and "csum %u != wanted %u", so "%u != wanted
%u" is the shape a reader of this function already expects. You're right
that the wanted value follows from value_size here and doesn't there --
what I was matching is the form, not the information content. Mikulas,
drop it when applying if you'd rather.

> Reproducer to validate the BUG_ON prevention using crafted metadata:
> create a cache device, and reduce the max_entries of the final array
> block of the mapping array. Next, expand the fast device to make the
> last array block exceeds its capacity, which triggers the BUG_ON in
> fill_ablock().

That is the path the equality test is there for -- an upper bound lets a
short max_entries through to fill_ablock() untouched. My A/B covered the
overread only, so that half was by inspection.

Thanks for the review.

Bryam


  reply	other threads:[~2026-08-08  9:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 22:54 [PATCH v2 0/2] dm array: validate array block headers, and against the caller Bryam Vargas via B4 Relay
2026-07-31 22:54 ` [PATCH v2 1/2] dm array: validate array block headers on read Bryam Vargas via B4 Relay
2026-08-03 13:41   ` Ming Hung Tsai
2026-08-08  8:59     ` Bryam Vargas [this message]
2026-08-10  9:09       ` Ming Hung Tsai
2026-07-31 22:54 ` [PATCH v2 2/2] dm array: reject an array block whose value size is not the caller's Bryam Vargas via B4 Relay
2026-08-03 14:24   ` Ming Hung Tsai
2026-08-08  8:59     ` Bryam Vargas

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=20260808085943.422108-1-hexlabsecurity@proton.me \
    --to=hexlabsecurity@proton.me \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=ejt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=mtsai@redhat.com \
    --cc=snitzer@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

all inboxes | Powered by JetHome®