LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Aleksa Sarai <cyphar@cyphar.com>
To: Ed Maste <emaste@freebsd.org>
Cc: David Drysdale <drysdale@google.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] namei: implement O_BENEATH-style AT_* flags
Date: Sat, 27 Oct 2018 18:17:29 +1100 [thread overview]
Message-ID: <20181027071729.xbnvfii6iwdwymrn@ryuk> (raw)
In-Reply-To: <20181027014114.GA52393@freebsd.org>
[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]
On 2018-10-27, Ed Maste <emaste@freebsd.org> wrote:
> On Tue, 9 Oct 2018 at 02:53, Aleksa Sarai <cyphar@cyphar.com> wrote:
> >
> > +#ifndef O_BENEATH
> > +#define O_BENEATH 00040000000 /* *Not* the same as capsicum's O_BENEATH! */
> > +#endif
> [...]
> O_BENEATH originally came from the Capsicum Linux port, and inherited the
> restriction against ".." path components from years ago when the port was
> done. In addition, FreeBSD did not originally implement O_BENEATH as the
> "beneath" behaviour is inherently provided once a process enters a
> capability mode sandbox. However, Capsicum now allows ".." paths, and
> FreeBSD supports O_BENEATH separately from capability mode. Absolute paths
> are not yet allowed with O_BENEATH but a change is in review to permit them.
What is the proposed semantic of O_BENEATH with absolute paths -- I
believe you don't have an openat(2) on FreeBSD (but please feel free to
correct me)?
> Ideally I would like to see us have the same API; none of this work has yet
> shipped in a FreeBSD release and there is an opportunity for us to make
> changes to match the interface and errors Linux may adopt.
I'm going to send out a v4 "soon" but I would like to know what folks
think about having resolveat(2) (or similar) to separate the scoping O_*
flags and produce an O_PATH -- since unsupported O_* flags are ignored
by older kernels userspace will have to do some plenty of checking after
each path operation.
Personally, I believe this (along with AT_EMPTY_PATH for openat(2))
would help with some other O_PATH issues.
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-10-27 7:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 6:52 [PATCH v2 0/3] namei: implement various lookup restriction " Aleksa Sarai
2018-10-09 6:52 ` Aleksa Sarai
2018-10-09 6:52 ` [PATCH v2 1/3] namei: implement O_BENEATH-style " Aleksa Sarai
2018-10-09 19:25 ` Andy Lutomirski
2018-10-10 7:07 ` Aleksa Sarai
2018-10-10 7:28 ` Aleksa Sarai
2018-10-12 1:12 ` Andy Lutomirski
2018-10-27 1:41 ` Ed Maste
2018-10-27 7:17 ` Aleksa Sarai [this message]
2018-10-27 7:53 ` Al Viro
2018-10-27 12:11 ` : " Ed Maste
2018-10-27 15:37 ` Aleksa Sarai
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=20181027071729.xbnvfii6iwdwymrn@ryuk \
--to=cyphar@cyphar.com \
--cc=drysdale@google.com \
--cc=emaste@freebsd.org \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH v2 1/3] namei: implement O_BENEATH-style AT_* flags' \
/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
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).