All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 00/36] remove in-kernel syscall invocations (part 1)
Date: Fri, 16 Mar 2018 00:38:15 +0000	[thread overview]
Message-ID: <CALCETrX_1pxfB10k-uj7vSyXm7hH4MeJiEY=+A3FzViaozb+BA@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a2-XfeM5J0dq0kiOSiQC4T4p7cggNbuMDoCmnqjKC9tEQ@mail.gmail.com>

On Thu, Mar 15, 2018 at 9:02 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thu, Mar 15, 2018 at 8:04 PM, Dominik Brodowski
> <linux@dominikbrodowski.net> wrote:
>> Here is a re-spin of the first set of patches which reduce the number of
>> syscall invocations from within the kernel; the RFC may be found at
>>
>> The rationale for this change is described in patch 1 as follows:
>>
>>         The syscall entry points to the kernel defined by SYSCALL_DEFINEx()
>>         and COMPAT_SYSCALL_DEFINEx() should only be called from userspace
>>         through kernel entry points, but not from the kernel itself. This
>>         will allow cleanups and optimizations to the entry paths *and* to
>>         the parts of the kernel code which currently need to pretend to be
>>         userspace in order to make use of syscalls.
>>
>> The whole series can be found at
>>
>>         https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git syscalls-next
>>
>> and will be submitted for merging for the v4.17-rc1 cycle, probably together
>> with another batch of related patches I hope to send out tomorrow as a RFC.
>
> Nice work!
>
> I've already commented on a few patches that now have a kernel-internal
> helper function that takes a __user pointer. I think those are all only used
> in the early boot code (initramfs etc) that runs before we set_fs() to the
> user address space, but it also causes warnings with sparse. If we
> can change all of them to take kernel pointers, that would let us avoid
> the sparse warnings and start running with a normal user address space
> view. Unfortunately, some of the syscall seem to be harder to change to
> that than others, so not sure if it's worth the effort.

It would be fantastic to get rid of set_fs() entirely and make it
impossible for get_user(), etc to ever access kernel memory.  And this
effort is necessary to ever achieve that.

I don't think this patch series should wait for any of these cleanups,
though.  We need these patches to change the x86_64 internal syscall
function signature, which we've been wanting to do for a little while.

  reply	other threads:[~2018-03-16  0:38 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 19:04 [PATCH v2 00/36] remove in-kernel syscall invocations (part 1) Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 01/36] syscalls: define goal to not call sys_xyzzy() from within the kernel Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 02/36] kernel: use kernel_wait4() instead of sys_wait4() Dominik Brodowski
2018-03-16 16:58   ` Luis R. Rodriguez
2018-03-17 16:44     ` Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 03/36] mm: use do_futex() instead of sys_futex() in mm_release() Dominik Brodowski
2018-03-16 11:58   ` Thomas Gleixner
2018-03-16 18:43   ` Darren Hart
2018-03-16 19:03     ` Andy Lutomirski
2018-03-16 21:44       ` Darren Hart
2018-03-17 16:39         ` Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 04/36] kernel: add do_getpgid() helper; remove internal call to sys_getpgid() Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 05/36] fs: add do_readlinkat() helper; remove internal call to sys_readlinkat() Dominik Brodowski
2018-03-15 19:04 ` [PATCH v2 06/36] fs: add do_pipe2() helper; remove internal call to sys_pipe2() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 07/36] fs: add do_renameat2() helper; remove internal call to sys_renameat2() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 08/36] fs: add do_futimesat() helper; remove internal call to sys_futimesat() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 09/36] syscalls: add do_epoll_*() helpers; remove internal calls to sys_epoll_*() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 10/36] fs: add do_signalfd4() helper; remove internal calls to sys_signalfd4() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 11/36] fs: add do_eventfd() helper; remove internal call to sys_eventfd() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 12/36] kernel: open-code sys_rt_sigpending() in sys_sigpending() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 13/36] x86/ioport: add ksys_ioperm() helper; remove in-kernel calls to sys_ioperm() Dominik Brodowski
2018-03-16  8:43   ` Christoph Hellwig
2018-03-16 11:13     ` Dominik Brodowski
2018-03-16 12:00   ` Thomas Gleixner
2018-03-16 14:45     ` Dominik Brodowski
2018-03-16 14:47       ` Thomas Gleixner
2018-03-15 19:05 ` [PATCH v2 14/36] fs: add ksys_mount() helper; remove in-kernel calls to sys_mount() Dominik Brodowski
2018-03-15 20:11   ` Arnd Bergmann
2018-03-16  8:46     ` Christoph Hellwig
2018-03-16 16:58     ` Linus Torvalds
2018-03-17 16:52     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 15/36] fs: add ksys_umount() helper; remove in-kernel call to sys_umount() Dominik Brodowski
2018-03-16  8:47   ` Christoph Hellwig
2018-03-17 16:58     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 16/36] fs: add ksys_dup{,3}() helper; remove in-kernel calls to sys_dup{,3}() Dominik Brodowski
2018-03-16  8:48   ` Christoph Hellwig
2018-03-17 17:01     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 17/36] fs: add ksys_chroot() helper; remove-in kernel calls to sys_chroot() Dominik Brodowski
2018-03-15 20:44   ` Arnd Bergmann
2018-03-16  8:49     ` Christoph Hellwig
2018-03-17 17:04     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 18/36] fs: add ksys_write() helper; remove in-kernel calls to sys_write() Dominik Brodowski
2018-03-16  8:52   ` Christoph Hellwig
2018-03-17 17:06     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 19/36] kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 20/36] mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 21/36] mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff() Dominik Brodowski
2018-03-15 20:54   ` Arnd Bergmann
2018-03-15 19:05 ` [PATCH v2 22/36] fs: add ksys_chdir() helper; remove in-kernel calls to sys_chdir() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 23/36] fs: add ksys_sync_file_range helper(); remove in-kernel calls to syscall Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 24/36] fs: add ksys_unlink() wrapper; remove in-kernel calls to sys_unlink() Dominik Brodowski
2018-03-15 20:21   ` Arnd Bergmann
2018-03-17 17:09     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 25/36] hostfs: rename do_rmdir() to hostfs_do_rmdir() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 26/36] fs: add ksys_rmdir() wrapper; remove in-kernel calls to sys_rmdir() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 27/36] fs: add do_mkdirat() helper and ksys_mkdir() wrapper; remove in-kernel calls to syscall Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 28/36] fs: add do_symlinkat() helper and ksys_symlink() " Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 29/36] fs: add do_mknodat() helper and ksys_mknod() " Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 30/36] fs: add do_linkat() helper and ksys_link() " Dominik Brodowski
2018-03-15 20:30   ` Arnd Bergmann
2018-03-17 17:11     ` Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 31/36] fs: add ksys_fchmod() and do_fchmodat() helpers and ksys_chmod() " Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 32/36] fs: add do_faccessat() helper and ksys_access() " Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 33/36] fs: add ksys_ftruncate() wrapper; remove in-kernel calls to sys_ftruncate() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 34/36] fs: add do_fchownat(), ksys_fchown() helpers and ksys_{,l}chown() wrappers Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 35/36] fs: add ksys_close() wrapper; remove in-kernel calls to sys_close() Dominik Brodowski
2018-03-15 19:05 ` [PATCH v2 36/36] fs: add ksys_open() wrapper; remove in-kernel calls to sys_open() Dominik Brodowski
2018-03-15 21:02 ` [PATCH v2 00/36] remove in-kernel syscall invocations (part 1) Arnd Bergmann
2018-03-16  0:38   ` Andy Lutomirski [this message]
2018-03-16  0:54     ` Linus Torvalds
2018-03-16  8:54       ` Christoph Hellwig
2018-03-16 14:20         ` Al Viro
2018-03-16 16:47           ` Linus Torvalds
2018-03-17 17:13   ` Dominik Brodowski
2018-03-16  9:01 ` Zhang, Ning A
2018-03-16 10:25   ` Dominik Brodowski

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='CALCETrX_1pxfB10k-uj7vSyXm7hH4MeJiEY=+A3FzViaozb+BA@mail.gmail.com' \
    --to=luto@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.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.