fsverity.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Alexander Larsson <alexl@redhat.com>,
	Amir Goldstein <amir73il@gmail.com>
Cc: Eric Biggers <ebiggers@kernel.org>,
	miklos@szeredi.hu, linux-unionfs@vger.kernel.org, tytso@mit.edu,
	fsverity@lists.linux.dev
Subject: Re: [PATCH v2 5/6] ovl: Validate verity xattr when resolving lowerdata
Date: Fri, 16 Jun 2023 21:14:16 +0800	[thread overview]
Message-ID: <f177a721-d137-424d-2fc5-adc149ea4766@linux.alibaba.com> (raw)
In-Reply-To: <CAL7ro1FUPQnwiN43jRZWAgdczPgYKj2H6Scx081gS-V+sC7cqA@mail.gmail.com>



On 2023/6/16 19:33, Alexander Larsson wrote:
> On Fri, Jun 16, 2023 at 11:28 AM Amir Goldstein <amir73il@gmail.com> wrote:
>>
>> On Fri, Jun 16, 2023 at 11:39 AM Alexander Larsson <alexl@redhat.com> wrote:
>>>
>>> On Fri, Jun 16, 2023 at 10:12 AM Amir Goldstein <amir73il@gmail.com> wrote:
>>>>
>>>>
>>>>> I don't believe this format will actually need to change much.
>>>>> However, I do agree
>>>>> with the general requirement for *some* ability to move forward with
>>>>> this format,
>>>>> so I'm gonna go with a single version byte.
>>>>>
>>>>
>>>> I disagree.
>>>> If you present a real life use case why that really matters
>>>> then I can reconsider.
>>>
>>> I disagree, but I'll add them.
>>>
>>
>> Let's ask for a 3rd opinion.
>> don't add them for now, unless Miklos says that you should.
> 
> I added them to the branch anyway for now. However, if we're going
> full header + flags anyway, I wonder if we really need the
> "overlay.digest" xattr at all? We could just put the header + optional
> digest in the "overlay.metacopy" xattr, and then just read/store one
> xattr. Right now metacopy is zero size, but adding some data to it
> would not break ovl_check_metacopy_xattr() in older kernels.
> 
> Basically, during the lookup we get the metacopy xattr anyway, and
> when we do we could record in a flag that there is a digest in it,
> then during open we don't have to look for a separate digest xattr,
> just re-load the metacopy xattr if the flag is set. With this in place
> we can also easily add other flags to overlay.metacopy, which imho
> makes a ton more sense than adding flags to overlay.digest.

My own slight concern about this is that:

Previously, all metacopy inodes shares a common EROFS shared xattr
which can be cached in memory once when the first read and other
inodes won't trigger any I/Os for this.

If "overlay.metacopy" xattr is not empty thus it cannot be shared,
I guess at least you could place it into an EROFS inline xattr, that
may be good as well if you also keep "header + flags".

But I'm not sure if it's a good idea to keep the full fsverity
digest in "overlay.metacopy" honestly, especially overlayfs
fsverity feature is off.  That will amplify I/Os (which could be
landed in EROFS shared xattrs as "overlay.digest" in the past and
now we need to read it immediately.)

Especially for the "ls -lR" workload, I guess you might need to
evaluate this way (only add flags vs flags + digest in
"overlay.metacopy") first.

Thanks,
Gao Xiang

> 
> I'll have a look at this.
> 

  parent reply	other threads:[~2023-06-16 13:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03  8:51 [PATCH v2 0/6] ovl: Add support for fs-verity checking of lowerdata Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 1/6] fsverity: Export fsverity_get_digest Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 2/6] ovl: Break out ovl_e_path_real() from ovl_i_path_real() Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 3/6] ovl: Break out ovl_e_path_lowerdata() from ovl_path_lowerdata() Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 4/6] ovl: Add framework for verity support Alexander Larsson
2023-05-03 11:51   ` Amir Goldstein
2023-05-14 19:22   ` Eric Biggers
2023-05-15  5:44     ` Alexander Larsson
2023-05-15  6:00       ` Eric Biggers
2023-05-15  6:46         ` Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 5/6] ovl: Validate verity xattr when resolving lowerdata Alexander Larsson
2023-05-03 15:35   ` Amir Goldstein
2023-05-14 19:16   ` Eric Biggers
2023-05-14 21:00     ` Amir Goldstein
2023-05-15  6:14       ` Alexander Larsson
2023-06-09 13:03         ` Amir Goldstein
2023-06-10 15:02           ` Alexander Larsson
2023-06-11 11:20             ` Amir Goldstein
2023-06-12 10:32               ` Alexander Larsson
2023-06-16  5:07                 ` Amir Goldstein
2023-06-16  5:24                   ` Eric Biggers
2023-06-16  5:55                     ` Amir Goldstein
2023-06-16  7:50                       ` Alexander Larsson
2023-06-16  8:12                         ` Amir Goldstein
2023-06-16  8:39                           ` Alexander Larsson
2023-06-16  9:27                             ` Amir Goldstein
2023-06-16 11:33                               ` Alexander Larsson
2023-06-16 12:24                                 ` Amir Goldstein
2023-06-16 12:28                                   ` Miklos Szeredi
2023-06-16 13:14                                 ` Gao Xiang [this message]
2023-05-15  6:12     ` Alexander Larsson
2023-05-03  8:51 ` [PATCH v2 6/6] ovl: Handle verity during copy-up Alexander Larsson
2023-05-03 15:33   ` Amir Goldstein
2023-05-14 19:09 ` [PATCH v2 0/6] ovl: Add support for fs-verity checking of lowerdata Eric Biggers
2023-05-14 21:25   ` Amir Goldstein
2023-05-14 22:19     ` Gao Xiang
2023-05-15  5:55     ` Alexander Larsson

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=f177a721-d137-424d-2fc5-adc149ea4766@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=alexl@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=fsverity@lists.linux.dev \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).