From: Alexander Larsson <alexl@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>, Amir Goldstein <amir73il@gmail.com>
Cc: Giuseppe Scrivano <gscrivan@redhat.com>,
Miklos Szeredi <mszeredi@redhat.com>,
linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/5] ovl: make redirect/metacopy rejection consistent
Date: Fri, 28 Mar 2025 10:04:40 +0100 [thread overview]
Message-ID: <a206a3113e834a40740f12e078d1301cb9fc22dc.camel@redhat.com> (raw)
In-Reply-To: <CAJfpegv44p8MhCWCQ2R93+iUCCrTZbk0KowZxVmsf=0tsbGHLA@mail.gmail.com>
On Thu, 2025-03-27 at 20:23 +0100, Miklos Szeredi wrote:
> On Thu, 27 Mar 2025 at 18:14, Amir Goldstein <amir73il@gmail.com>
> wrote:
> > origin xattr only checks from upper to uppermost lower layer IIRC,
> > do definitely not all the way to lowerdata inode.
>
> Makes sense.
>
> > > so as long as the user is unable to change the origin integrity
> > > should
> > > be guaranteed. IOW, what we need is just to always check origin
> > > on
> > > metacopy regardless of the index option.
> > >
> > > But I'm not even sure this is used at all, since the verity code
> > > was
> > > added for the composefs use case, which does not use this path
> > > AFAICS.
> > > Alex, can you clarify?
> >
> > I am not sure how composefs lowerdata layer is being deployed,
> > but but I am pretty sure that the composefs erofs layers are
> > designed to be migratable to any fs where the lowerdata repo
> > exists, so I think hard coding the lowerdata inode is undesired.
>
> Yeah, I understand the basic composefs architecture, and storing the
> digest in the metadata inode makes perfect sense.
>
> What I'm not sure is what is being used outside of that.
>
> Anyway, I don't see any issue with the current architecture, just
> trying to understand what this is useful for and possible
> simplifications based on that.
>
> For example the copy-up code is apparently unused, and could be
> removed. OTOH it could be useful for the idmapping case from
> Guiseppe.
I think there are two basic composefs usecases, first a completely
read-only one with a data-only, an erofs lower and nothing more. The
traditional example here is a read-only rootfs. In this case, clearly
digest copy-up is not needed.
The second usecase is when you use composefs for a container image,
similar to use case 1, but on top of that you have the writable upper
layer that is for the running container itself. In this case, you want
to validate all accesses to the lower layer, but allow the container to
make changes. Obviously, once you create a new file, or modify a lower
one there will not be any validation of that file.
However, if you for example change just file ownership, then you may
trigger a meta-copy-up, and at this point it makes sense to also copy
up the digest to the metacopy file, because otherwise accesses to it
would read the datadir file without validating its digest.
Unfortunately this (as you say) weakens the security in the case the
raw upperdir is not trusted, as it would allow the digest xattr to be
changed. But I think this is acceptable, because the alternative
without meta-copy-up is a full copy up, but then you can change the
file data in the upper instead, which is even worse.
As for origin checks, they are really never interesting to any
composefs-style usecase, because those are fundamentally about
transporting images between different systems (with different
filesystems, inodes, etc).
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=
Alexander Larsson Red Hat,
Inc
alexl@redhat.com alexander.larsson@gmail.com
He's a superhumanly strong coffee-fuelled firefighter who hides his
scarred face behind a mask. She's a sarcastic mute opera singer who
inherited a spooky stately manor from her late maiden aunt. They fight
crime!
next prev parent reply other threads:[~2025-03-28 9:04 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 19:45 [PATCH 1/5] ovl: don't allow datadir only Miklos Szeredi
2025-02-10 19:45 ` [PATCH 2/5] ovl: remove unused forward declaration Miklos Szeredi
2025-02-11 10:02 ` Amir Goldstein
2025-02-10 19:45 ` [PATCH 3/5] ovl: make redirect/metacopy rejection consistent Miklos Szeredi
2025-02-11 11:13 ` Amir Goldstein
2025-02-11 11:46 ` Miklos Szeredi
2025-02-11 12:00 ` Amir Goldstein
2025-02-11 12:34 ` Miklos Szeredi
2025-02-11 15:51 ` Amir Goldstein
2025-02-12 16:57 ` Miklos Szeredi
2025-02-20 9:53 ` Giuseppe Scrivano
2025-02-20 11:25 ` Miklos Szeredi
2025-02-20 11:39 ` Giuseppe Scrivano
2025-02-20 11:47 ` Miklos Szeredi
2025-03-25 12:16 ` Amir Goldstein
2025-03-27 15:28 ` Miklos Szeredi
2025-03-27 17:13 ` Amir Goldstein
2025-03-27 19:23 ` Miklos Szeredi
2025-03-28 9:04 ` Alexander Larsson [this message]
2025-03-27 22:20 ` Colin Walters
2025-03-25 10:57 ` Miklos Szeredi
2025-03-25 11:18 ` Alexander Larsson
2025-03-25 13:34 ` Giuseppe Scrivano
2025-03-25 13:42 ` Miklos Szeredi
2025-03-25 14:16 ` Alexander Larsson
[not found] ` <CAGUVWovzT=7Gj2nj-RWC9g5_KWMzPPzAbFs9-xKWpFuh8iFTiw@mail.gmail.com>
2025-03-25 14:04 ` Alexander Larsson
2025-02-10 19:45 ` [PATCH 4/5] ovl: don't require metacopy=on for lower -> data redirect Miklos Szeredi
2025-02-11 12:08 ` Amir Goldstein
2025-02-10 19:45 ` [PATCH 5/5] ovl: don't require "metacopy=on" for "verity" Miklos Szeredi
2025-02-11 10:49 ` Amir Goldstein
2025-02-11 12:14 ` Miklos Szeredi
2025-02-11 12:24 ` Amir Goldstein
2025-02-11 10:01 ` [PATCH 1/5] ovl: don't allow datadir only Amir Goldstein
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=a206a3113e834a40740f12e078d1301cb9fc22dc.camel@redhat.com \
--to=alexl@redhat.com \
--cc=amir73il@gmail.com \
--cc=gscrivan@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@redhat.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).