linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: Ed Maste <emaste@freebsd.org>,
	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 08:53:49 +0100	[thread overview]
Message-ID: <20181027075348.GN32577@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20181027071729.xbnvfii6iwdwymrn@ryuk>

On Sat, Oct 27, 2018 at 06:17:29PM +1100, Aleksa Sarai wrote:

> 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.

The trouble with resolveat(2) is that for anything directory-modifying
you really want directory locked before the lookup for last component.
IOW, funlink(2) et.al. are hopeless.  You can, of course, do O_PATH
open for everything sans the last component, and do unlinkat() with
the base being the result of that open and the last component for
relative pathname, but that takes more work on the userland side than
you probably want to bother with.

IOW, pathname resolution for directory entry is seriously different from
that for fs object.  And you obviously don't want to return from a syscall
with directory locked.

  reply	other threads:[~2018-10-27  7:53 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 AT_* flags 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
2018-10-27  7:53       ` Al Viro [this message]
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=20181027075348.GN32577@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=cyphar@cyphar.com \
    --cc=drysdale@google.com \
    --cc=emaste@freebsd.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).