All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Sargun Dhillon <sargun@sargun.me>,
	Giuseppe Scrivano <gscrivan@redhat.com>,
	Robert Sesek <rsesek@google.com>,
	Chris Palmer <palmer@google.com>, Jann Horn <jannh@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"containers@lists.linux-foundation.org"
	<containers@lists.linux-foundation.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Matt Denton <mpdenton@google.com>, Tejun Heo <tj@kernel.org>,
	David Laight <David.Laight@ACULAB.COM>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 1/4] fs, net: Standardize on file_receive helper to move fds across processes
Date: Fri, 12 Jun 2020 11:38:33 -0700	[thread overview]
Message-ID: <202006121135.F04D66DFA@keescook> (raw)
In-Reply-To: <20200612182816.okwylihs6u6wkgxd@wittgenstein>

On Fri, Jun 12, 2020 at 08:28:16PM +0200, Christian Brauner wrote:
> Al didn't want the PAGE_SIZE limit in there because there's nothing
> inherently wrong with copying insane amounts of memory.

Right, ok.

> (Another tangent. I've asked this on Twitter not too long ago: do we
> have stats how long copy_from_user()/copy_struct_from_user() takes with
> growing struct/memory size? I'd be really interested in this. I have a
> feeling that clone3()'s and - having had a chat with David Howells -
> openat2()'s structs will continue to grow for a while... and I'd really
> like to have some numbers on when copy_struct_from_user() becomes
> costly or how costly it becomes.)

How long it takes? It should be basically the same, the costs should be
mostly in switching memory protections, etc. I wouldn't imagine how many
bytes being copied would matter much here, given the sub-page sizes.

> > Ah yeah, I like this because of what you mention below: it's forward
> > compat too. (I'd just use the ioctl masks directly...)
> > 
> > 	switch (cmd & ~(_IOC_SIZEMASK | _IOC_DIRMASK))
> > 
> > > 		return seccomp_notify_addfd(filter, buf, _IOC_SIZE(cmd));
> > 
> > I really like that this ends up having the same construction as a
> > standard EA syscall: the size is part of the syscall arguments.
> 
> This is basically what I had proposed in my previous mail, right?

I guess I missed it! Well, then I think we're all in agreement? :)

-- 
Kees Cook

  reply	other threads:[~2020-06-12 18:38 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  1:10 [PATCH v3 0/4] Add seccomp notifier ioctl that enables adding fds Sargun Dhillon
     [not found] ` <20200603011044.7972-1-sargun-GaZTRHToo+CzQB+pC5nmwQ@public.gmane.org>
2020-06-03  1:10   ` [PATCH v3 1/4] fs, net: Standardize on file_receive helper to move fds across processes Sargun Dhillon
2020-06-03  1:10     ` Sargun Dhillon
     [not found]     ` <20200603011044.7972-2-sargun-GaZTRHToo+CzQB+pC5nmwQ@public.gmane.org>
2020-06-04  1:24       ` Christian Brauner
2020-06-04  1:24         ` Christian Brauner
2020-06-04  2:22         ` Kees Cook
2020-06-04  5:20           ` Sargun Dhillon
2020-06-04 12:52           ` Christian Brauner
2020-06-04 13:28             ` David Laight
2020-06-04 13:28               ` David Laight
2020-06-05  7:54             ` Sargun Dhillon
2020-06-09 19:43               ` Kees Cook
2020-06-09 20:03                 ` Christian Brauner
2020-06-09 20:03                   ` Christian Brauner
2020-06-09 20:55                   ` Kees Cook
2020-06-09 21:27                     ` Christian Brauner
     [not found]                       ` <037A305F-B3F8-4CFA-B9F8-CD4C9EF9090B-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2020-06-10  5:27                         ` Kees Cook
2020-06-10  5:27                           ` Kees Cook
2020-06-10  8:12                           ` Sargun Dhillon
2020-06-10  8:48                             ` David Laight
2020-06-10  8:48                               ` David Laight
     [not found]                               ` <40d76a9a4525414a8c9809cd29a7ba8e-1XygrNkDbNvwg4NCKwmqgw@public.gmane.org>
2020-06-11  3:02                                 ` Kees Cook
2020-06-11  3:02                                   ` Kees Cook
2020-06-11  7:51                                   ` David Laight
2020-06-11  7:51                                     ` David Laight
     [not found]                             ` <20200610081237.GA23425-du9IEJ8oIxHXYT48pCVpJ3c7ZZ+wIVaZYkHkVr5ML8kVGlcevz2xqA@public.gmane.org>
2020-06-10 17:10                               ` Kees Cook
2020-06-10 17:10                                 ` Kees Cook
2020-06-11  2:59                               ` Kees Cook
2020-06-11  2:59                                 ` Kees Cook
2020-06-11  4:41                                 ` Sargun Dhillon
2020-06-11  4:41                                   ` Sargun Dhillon
2020-06-11  9:19                                 ` Christian Brauner
2020-06-11 10:39                                   ` Sargun Dhillon
2020-06-11 23:23                                     ` Kees Cook
2020-06-11 10:01                                 ` Christian Brauner
2020-06-11 10:01                                   ` Christian Brauner
2020-06-11 11:06                                   ` Sargun Dhillon
     [not found]                                     ` <20200611110630.GB30103-du9IEJ8oIxHXYT48pCVpJ3c7ZZ+wIVaZYkHkVr5ML8kVGlcevz2xqA@public.gmane.org>
2020-06-11 14:42                                       ` Christian Brauner
2020-06-11 14:42                                         ` Christian Brauner
2020-06-11 14:56                                     ` David Laight
2020-06-11 23:49                                       ` Kees Cook
2020-06-11 23:49                                         ` Kees Cook
2020-06-12  6:58                                         ` Kees Cook
2020-06-12  6:58                                           ` Kees Cook
2020-06-12  8:36                                         ` David Laight
2020-06-12  8:36                                           ` David Laight
     [not found]                                           ` <94407449bedd4ba58d85446401ff0a42-1XygrNkDbNvwg4NCKwmqgw@public.gmane.org>
2020-06-12 10:46                                             ` Sargun Dhillon
2020-06-12 10:46                                               ` Sargun Dhillon
     [not found]                                               ` <20200612104629.GA15814-du9IEJ8oIxHXYT48pCVpJ3c7ZZ+wIVaZYkHkVr5ML8kVGlcevz2xqA@public.gmane.org>
2020-06-12 15:13                                                 ` Kees Cook
2020-06-12 15:13                                                   ` Kees Cook
2020-06-12 15:55                                                   ` David Laight
2020-06-12 18:28                                                   ` Christian Brauner
2020-06-12 18:38                                                     ` Kees Cook [this message]
2020-06-12 18:42                                                       ` Christian Brauner
2020-06-15  8:27                                                     ` David Laight
2020-06-10  9:30                         ` Christian Brauner
2020-06-10  9:30                           ` Christian Brauner
2020-06-04  3:39         ` Sargun Dhillon
2020-06-03  1:10   ` [PATCH v3 2/4] pid: Use file_receive helper to copy FDs Sargun Dhillon
2020-06-03  1:10     ` Sargun Dhillon
2020-06-03  1:10 ` [PATCH v3 3/4] seccomp: Introduce addfd ioctl to seccomp user notifier Sargun Dhillon
2020-06-03  1:10 ` [PATCH v3 4/4] selftests/seccomp: Test SECCOMP_IOCTL_NOTIF_ADDFD Sargun Dhillon
2020-06-03 21:25 ` [PATCH v3 0/4] Add seccomp notifier ioctl that enables adding fds Robert Sesek
2020-06-03 23:42 ` Kees Cook
2020-06-03 23:56   ` Sargun Dhillon
2020-06-04  2:44     ` Kees Cook

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=202006121135.F04D66DFA@keescook \
    --to=keescook@chromium.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=cgroups@vger.kernel.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=gscrivan@redhat.com \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpdenton@google.com \
    --cc=palmer@google.com \
    --cc=rsesek@google.com \
    --cc=sargun@sargun.me \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.