From: Christian Brauner <brauner@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: "Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>,
miklos@szeredi.hu, linux-unionfs@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] ovl: disable nfs_export for same-sb lower layers with different idmaps
Date: Fri, 25 Sep 2026 15:51:42 +0200 [thread overview]
Message-ID: <20260925-server-hager-riskieren-06116eded213@brauner> (raw)
In-Reply-To: <CAOQ4uxhyc5x3LDzbJtRhQJ+JNQ-hES2k45jcxeGsfEWPB24TKA@mail.gmail.com>
On Mon, Sep 21, 2026 at 10:10:28AM +0200, Amir Goldstein wrote:
> On Sun, Sep 20, 2026 at 10:33 PM Jérémy Jean
> <Jeremy.Jean@oss.cyber.gouv.fr> wrote:
> >
> > Overlay file handles identify a backing filesystem, but not the lower
> > mount used to decode it. If lower layers share a superblock and use
> > different idmaps, a file handle can decode through the wrong layer and
> > initialize the overlay inode with the wrong owner.
> >
> > Track the first lower idmap seen for each ovl_sb and disable nfs_export
> > when another lower layer on the same backing superblock uses a different
> > idmap. Keep index enabled: copy up starts from the overlay dentry selected
> > by lookup and does not need to decode a lower file handle through another
> > layer.
> >
> > Fixes: bc70682a497c ("ovl: support idmapped layers")
> > Assisted-by: Codex:gpt-5
> > Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
> > ---
> > fs/overlayfs/ovl_entry.h | 2 ++
> > fs/overlayfs/super.c | 28 +++++++++++++++++++++++++++-
> > 2 files changed, 29 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
> > index 80cad4ea96a3..2a6e12a0d4dd 100644
> > --- a/fs/overlayfs/ovl_entry.h
> > +++ b/fs/overlayfs/ovl_entry.h
> > @@ -24,6 +24,8 @@ struct ovl_config {
> > struct ovl_sb {
> > struct super_block *sb;
> > dev_t pseudo_dev;
> > + /* Idmap of the first lower layer on this fs */
> > + struct mnt_idmap *lower_idmap;
> > /* Unusable (conflicting) uuid */
> > bool bad_uuid;
> > /* Used as a lower layer (but maybe also as upper) */
> > diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> > index bd0a3f9039d2..8e78da420b75 100644
> > --- a/fs/overlayfs/super.c
> > +++ b/fs/overlayfs/super.c
> > @@ -944,6 +944,24 @@ static bool ovl_lower_uuid_ok(struct ovl_fs *ofs, const uuid_t *uuid)
> > return true;
> > }
> >
> > +/*
> > + * Lower file handles identify a lower fs, but not the mount whose idmap was
> > + * used to decode them. Remember the first lower idmap seen for each fs so
> > + * decodable export handles can be disabled if another one appears.
I find this behavior counterintuitive. Shouldn't we just fail the mount then?
next prev parent reply other threads:[~2026-09-25 13:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 20:32 [PATCH v2 0/3] ovl: disable nfs_export for mixed-idmap same-sb lower layers Jérémy Jean
2026-09-20 20:32 ` [PATCH v2 1/3] ovl: disable nfs_export for same-sb lower layers with different idmaps Jérémy Jean
2026-09-21 8:10 ` Amir Goldstein
2026-09-25 13:51 ` Christian Brauner [this message]
2026-09-25 14:17 ` Amir Goldstein
2026-09-20 20:32 ` [PATCH v2 2/3] selftests: overlayfs: reject handles for mixed lower idmaps Jérémy Jean
2026-09-21 8:14 ` Amir Goldstein
2026-09-20 20:32 ` [PATCH v2 3/3] selftests: overlayfs: keep index copy up with " Jérémy Jean
2026-09-21 8:18 ` Amir Goldstein
2026-09-21 8:03 ` [PATCH v2 0/3] ovl: disable nfs_export for mixed-idmap same-sb lower layers Amir Goldstein
2026-09-21 8:22 ` Jérémy Jean
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=20260925-server-hager-riskieren-06116eded213@brauner \
--to=brauner@kernel.org \
--cc=Jeremy.Jean@oss.cyber.gouv.fr \
--cc=amir73il@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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