linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tycho Andersen <tycho@tycho.pizza>
To: Christian Brauner <brauner@kernel.org>
Cc: aloktiagi <aloktiagi@gmail.com>,
	viro@zeniv.linux.org.uk, willy@infradead.org,
	David.Laight@aculab.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, keescook@chromium.org,
	hch@infradead.org
Subject: Re: [RFC v4 2/2] file, epoll: Implement do_replace() and eventpoll_replace()
Date: Mon, 27 Mar 2023 07:16:39 -0600	[thread overview]
Message-ID: <ZCGXNwvymHVJ7O6K@tycho.pizza> (raw)
In-Reply-To: <ZCGU5JBg02+DU6JN@tycho.pizza>

On Mon, Mar 27, 2023 at 07:06:46AM -0600, Tycho Andersen wrote:
> On Mon, Mar 27, 2023 at 11:01:06AM +0200, Christian Brauner wrote:
> > On Fri, Mar 24, 2023 at 07:43:13AM -0600, Tycho Andersen wrote:
> > > Perhaps we could add a flag that people could set from SECCOMP_ADDFD
> > > asking for this extra behavior?
> > 
> >         +       if (fd > 0 && addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_EPOLL) {
> >         +               /*
> >         +                * - retrieve old struct file that addfd->fd refered to if any.
> >         +                * - call your epoll seccomp api to update the references in the epoll instance
> >         +                */
> > 			epoll_seccomp_notify()
> >         +       }
> >         +
> >         +       if (fd > 0 && addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_IO_URING) {
> >         +               /*
> >         +                * - call your io_uring seccomp api to update the references in the io_uring instance
> >         +                */
> > 			io_uring_seccomp_notify()
> >         +       }
> 
> Looks reasonable to me, thanks.

One change I might suggest is only using a single flag bit -- we don't
need to consume all of seccomp's remaining flag bits with the various
subsystems. If you want to do this logic for epoll, you almost
certainly want it for io_uring, select, and whatever else is out
there.

Tycho

  reply	other threads:[~2023-03-27 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18  6:02 [RFC v2 1/3] file: Introduce iterate_fd_locked aloktiagi
2023-03-18  6:02 ` [RFC v2 2/3] file: allow callers to free the old file descriptor after dup2 aloktiagi
2023-03-18  6:02 ` [RFC v2 3/3] file, epoll: Implement do_replace() and eventpoll_replace() aloktiagi
2023-03-20 14:51   ` Christian Brauner
2023-03-23 22:23     ` Alok Tiagi
2023-03-24  8:23       ` [RFC v4 2/2] " Christian Brauner
2023-03-24 13:43         ` Tycho Andersen
2023-03-27  9:01           ` Christian Brauner
2023-03-27 13:06             ` Tycho Andersen
2023-03-27 13:16               ` Tycho Andersen [this message]
2023-03-27 20:39                 ` Alok Tiagi
  -- strict thread matches above, loose matches on Subject: below --
2023-03-24  6:34 [RFC v4 1/2] file: allow callers to free the old file descriptor after dup2 aloktiagi
2023-03-24  6:34 ` [RFC v4 2/2] file, epoll: Implement do_replace() and eventpoll_replace() aloktiagi

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=ZCGXNwvymHVJ7O6K@tycho.pizza \
    --to=tycho@tycho.pizza \
    --cc=David.Laight@aculab.com \
    --cc=aloktiagi@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hch@infradead.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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).