mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Sakai <msakai@redhat.com>
To: Ivan Abramov <i.abramov@mt-integration.ru>
Cc: Mike Snitzer <snitzer@kernel.org>,
	"J. corwin Coburn" <corwin@hurlbutnet.net>,
	dm-devel@lists.linux.dev, Thomas Jaskiewicz <tom@jaskiewicz.us>,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH v2 1/1] Return error on corrupted metadata in start_restoring_volume functions
Date: Tue, 9 Sep 2025 16:59:07 -0400	[thread overview]
Message-ID: <39ac9482-75a7-4124-9caa-5d0550c677fa@redhat.com> (raw)
In-Reply-To: <20250909202242.355086-1-i.abramov@mt-integration.ru>



On 9/9/25 4:22 PM, Ivan Abramov wrote:
> The return values of VDO_ASSERT calls that validate metadata are not acted
> upon.
> 
> Return UDS_CORRUPT_DATA in case of an error.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: a4eb7e255517 ("dm vdo: implement the volume index")
> Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>

(cc'ing dm-devel this time)
Reviewed-by: Matthew Sakai <msakai@redhat.com>

> ---
> v2: Change approach as per Matthew Sakai's <msakai@redhat.com> suggestion.
> Change subject and description accordingly. Also add Fixes tag.
> 
>   drivers/md/dm-vdo/indexer/volume-index.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/dm-vdo/indexer/volume-index.c b/drivers/md/dm-vdo/indexer/volume-index.c
> index 12f954a0c532..afb062e1f1fb 100644
> --- a/drivers/md/dm-vdo/indexer/volume-index.c
> +++ b/drivers/md/dm-vdo/indexer/volume-index.c
> @@ -836,7 +836,7 @@ static int start_restoring_volume_sub_index(struct volume_sub_index *sub_index,
>   				    "%zu bytes decoded of %zu expected", offset,
>   				    sizeof(buffer));
>   		if (result != VDO_SUCCESS)
> -			result = UDS_CORRUPT_DATA;
> +			return UDS_CORRUPT_DATA;
>   
>   		if (memcmp(header.magic, MAGIC_START_5, MAGIC_SIZE) != 0) {
>   			return vdo_log_warning_strerror(UDS_CORRUPT_DATA,
> @@ -928,7 +928,7 @@ static int start_restoring_volume_index(struct volume_index *volume_index,
>   				    "%zu bytes decoded of %zu expected", offset,
>   				    sizeof(buffer));
>   		if (result != VDO_SUCCESS)
> -			result = UDS_CORRUPT_DATA;
> +			return UDS_CORRUPT_DATA;
>   
>   		if (memcmp(header.magic, MAGIC_START_6, MAGIC_SIZE) != 0)
>   			return vdo_log_warning_strerror(UDS_CORRUPT_DATA,


      reply	other threads:[~2025-09-09 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 20:22 Ivan Abramov
2025-09-09 20:59 ` Matthew Sakai [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=39ac9482-75a7-4124-9caa-5d0550c677fa@redhat.com \
    --to=msakai@redhat.com \
    --cc=corwin@hurlbutnet.net \
    --cc=dm-devel@lists.linux.dev \
    --cc=i.abramov@mt-integration.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=snitzer@kernel.org \
    --cc=tom@jaskiewicz.us \
    /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®