[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQ+UGsvfAM8-E8Ft3neFkz4+TjE=rPbP1sw1m5_4H9BPNg@mail.gmail.com>
Date: Thu, 29 May 2025 09:57:29 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Song Liu <song@...nel.org>
Cc: Jan Kara <jack@...e.cz>, Al Viro <viro@...iv.linux.org.uk>, bpf <bpf@...r.kernel.org>,
Linux-Fsdevel <linux-fsdevel@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
LSM List <linux-security-module@...r.kernel.org>, Kernel Team <kernel-team@...a.com>,
Andrii Nakryiko <andrii@...nel.org>, Eduard <eddyz87@...il.com>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>, Christian Brauner <brauner@...nel.org>, KP Singh <kpsingh@...nel.org>,
Matt Bobrowski <mattbobrowski@...gle.com>, Amir Goldstein <amir73il@...il.com>, repnop@...gle.com,
Jeff Layton <jlayton@...nel.org>, Josef Bacik <josef@...icpanda.com>,
Mickaël Salaün <mic@...ikod.net>,
Günther Noack <gnoack@...gle.com>
Subject: Re: [PATCH bpf-next 3/4] bpf: Introduce path iterator
On Thu, May 29, 2025 at 9:53 AM Song Liu <song@...nel.org> wrote:
>
> Hi Al and Jan,
>
> Thanks for your review!
>
> On Thu, May 29, 2025 at 4:58 AM Jan Kara <jack@...e.cz> wrote:
> >
> > On Wed 28-05-25 23:37:24, Al Viro wrote:
> > > On Wed, May 28, 2025 at 03:26:22PM -0700, Song Liu wrote:
> > > > Introduce a path iterator, which reliably walk a struct path.
> > >
> > > No, it does not. If you have no external warranty that mount
> > > *and* dentry trees are stable, it's not reliable at all.
> >
> > I agree that advertising this as "reliable walk" is misleading. It is
> > realiable in the sense that it will not dereference freed memory, leak
> > references etc. As you say it is also reliable in the sense that without
> > external modifications to dentry & mount tree, it will crawl the path to
> > root. But in presence of external modifications the only reliability it
> > offers is "it will not crash". E.g. malicious parallel modifications can
> > arbitrarily prolong the duration of the walk.
>
> How about we describe this as:
>
> Introduce a path iterator, which safely (no crash) walks a struct path.
> Without malicious parallel modifications, the walk is guaranteed to
> terminate. The sequence of dentries maybe surprising in presence
> of parallel directory or mount tree modifications and the iteration may
> not ever finish in face of parallel malicious directory tree manipulations.
Hold on. If it's really the case then is the landlock susceptible
to this type of attack already ?
landlock may infinitely loop in the kernel ?
Powered by blists - more mailing lists