From: "길영진/System Core Lab.(MX)/삼성전자" <youngjin.gil@samsung.com>
To: "'Eric Biggers'" <ebiggers@kernel.org>
Cc: <agk@redhat.com>, <snitzer@kernel.org>, <dm-devel@redhat.com>,
<linux-kernel@vger.kernel.org>,
"'Sungjong Seo'" <sj1557.seo@samsung.com>,
"'Nathan Huckleberry'" <nhuck@google.com>,
"'Sami Tolvanen'" <samitolvanen@google.com>
Subject: RE: [PATCH] dm verity: fix error handling for check_at_most_once
Date: Fri, 17 Mar 2023 15:18:20 +0900 [thread overview]
Message-ID: <000001d95898$456301d0$d0290570$@samsung.com> (raw)
In-Reply-To: <ZBNjcA1feNWUxvaW@gmail.com>
Hi Eric,
Thank you for your detailed feedback.
> Hi Yeongjin,
>
> On Thu, Mar 16, 2023 at 12:18:42PM +0900, Yeongjin Gil wrote:
> > In verity_work(), the return value of verity_verify_io() is converted
> > to blk_status and passed to verity_finish_io(). BTW, when a bit is set
> > in
> > v->validated_blocks, verity_verify_io() skips verification regardless
> > v->of
> > I/O error for the corresponding bio. In this case, the I/O error could
> > not be returned properly, and as a result, there is a problem that
> > abnormal data could be read for the corresponding block.
> >
> > To fix this problem, when an I/O error occurs, do not skip
> > verification even if the bit related is set in v->validated_blocks.
> >
> > Fixes: 843f38d382b1 ("dm verity: add 'check_at_most_once' option to
> > only validate hashes once")
> >
> > Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
> > Signed-off-by: Yeongjin Gil <youngjin.gil@samsung.com>
> > ---
> > drivers/md/dm-verity-target.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/md/dm-verity-target.c
> > b/drivers/md/dm-verity-target.c index ade83ef3b439..9316399b920e
> > 100644
> > --- a/drivers/md/dm-verity-target.c
> > +++ b/drivers/md/dm-verity-target.c
> > @@ -523,7 +523,7 @@ static int verity_verify_io(struct dm_verity_io *io)
> > sector_t cur_block = io->block + b;
> > struct ahash_request *req = verity_io_hash_req(v, io);
> >
> > - if (v->validated_blocks &&
> > + if (v->validated_blocks && bio->bi_status == BLK_STS_OK &&
> > likely(test_bit(cur_block, v->validated_blocks))) {
> > verity_bv_skip_block(v, io, iter);
> > continue;
>
> Thanks for sending this patch! This looks like a correct fix, but I have
> some
> comments:
>
> * Using "check_at_most_once" is strongly discouraged, as it reduces
> security.
> If you are using check_at_most_once to improve performance at the cost
> of
> reduced security, please consider that very recently, dm-verity
> performance
> has significantly improved due to the removal of the WQ_UNBOUND
> workqueue flag
> which was causing significant I/O latency. See commit c25da5b7baf1
> ("dm verity: stop using WQ_UNBOUND for verify_wq").
>
> * I think your commit message does not explain a key aspect of the problem
> which
> is why is verity even attempted when the underlying I/O has failed?
> This
> appears to be because of the Forward Error Correction (FEC) feature.
So,
> this
> issue is specific to the case where both FEC and check_at_most_once is
> used.
> Can you make your commit message explain this?
Okay. I will update commit message.
>
> * This patch does not appear to have been received by the dm-devel mailing
> list,
> which is the list where dm-verity patches should be reviewed on. It
> doesn't
> show up in the archive at https://lore.kernel.org/dm-devel. Also, I'm
> subscribed to dm-devel and I didn't receive this patch in my inbox. (I
> had to
> download it from https://lore.kernel.org/lkml instead.) Did you receive
> a
> bounce message when you sent this patch?
I am not sure but I received message from googlemail.com as follow
"totte@google.com because the address couldn't be found".
I will try to send v2 patch exclude totte@google.com and check the mailing.
>
> * Please add 'Cc: stable@vger.kernel.org' to the commit message, just
> below the
> Fixes line, as per Documentation/process/stable-kernel-rules.rst. This
> will
> ensure that the fix will be backported to the stable kernels.
Okay.
>
> * "Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>" does not have a
> corresponding Author or Co-developed-line, which is not allowed. Did
> you mean
> to list Sungjong as the Author or as a co-author?
I created a patch through an internal review with Sungjong.
I will change the tag to "Reviewed-by"
>
> * No blank line between Fixes and the Signed-off-by line(s), please.
Okay. Thanks. I will send v2 patch soon.
>
> Thanks!
>
> - Eric
prev parent reply other threads:[~2023-03-17 6:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230316031936epcas1p1ebd93477dcf3bf9ab1640306dd1da8ff@epcas1p1.samsung.com>
2023-03-16 3:18 ` Yeongjin Gil
2023-03-16 18:44 ` Eric Biggers
2023-03-17 6:18 ` 길영진/System Core Lab.(MX)/삼성전자 [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='000001d95898$456301d0$d0290570$@samsung.com' \
--to=youngjin.gil@samsung.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ebiggers@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nhuck@google.com \
--cc=samitolvanen@google.com \
--cc=sj1557.seo@samsung.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®