Skip to content

remove in-kernel syscall invocations (part 2 == netdev)

Dominik Brodowski lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22net: socket: add __sys_recvfrom() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+21 -90 replies
2/22net: socket: add __sys_sendto() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+17 -80 replies
3/22net: socket: add __sys_accept4() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+17 -90 replies
4/22net: socket: add __sys_socket() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+9 -30 replies
5/22net: socket: add __sys_bind() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+9 -30 replies
6/22net: socket: add __sys_connect() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+11 -40 replies
7/22net: socket: add __sys_listen() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+9 -30 replies
8/22net: socket: add __sys_getsockname() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+13 -50 replies
9/22net: socket: add __sys_getpeername() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+13 -50 replies
10/22net: socket: add __sys_socketpair() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+11 -40 replies
11/22net: socket: add __sys_shutdown() helper; remove in-kernel call to syscallinclude/linux/socket.h net/compat.c net/socket.c+9 -30 replies
12/22net: socket: add __sys_setsockopt() helper; remove in-kernel call to syscallinclude/linux/socket.h net/socket.c+11 -30 replies
13/22net: socket: add __sys_getsockopt() helper; remove in-kernel call to syscallnet/socket.c+10 -40 replies
14/22net: socket: add do_sys_recvmmsg() helper; remove in-kernel call to syscallnet/socket.c+12 -50 replies
15/22net: socket: move check for forbid_cmsg_compat to __sys_...msg()include/linux/socket.h net/compat.c net/socket.c+37 -220 replies
16/22net: socket: replace calls to sys_send() with __sys_sendto()net/compat.c net/socket.c+3 -20 replies
17/22net: socket: replace call to sys_recv() with __sys_recvfrom()net/compat.c net/socket.c+4 -20 replies
18/22net: socket: add __compat_sys_recvfrom() helper; remove in-kernel call to compat syscallnet/compat.c+16 -70 replies
19/22net: socket: add __compat_sys_setsockopt() helper; remove in-kernel call to compat syscallnet/compat.c+10 -40 replies
20/22net: socket: add __compat_sys_getsockopt() helper; remove in-kernel call to compat syscallnet/compat.c+12 -40 replies
21/22net: socket: add __compat_sys_recvmmsg() helper; remove in-kernel call to compat syscallnet/compat.c+12 -50 replies
22/22net: socket: add __compat_sys_...msg() helpers; remove in-kernel calls to compat syscallsnet/compat.c+30 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH -next 00/22] remove in-kernel syscall invocations (part 2 == netdev)

Here is another series of patches which reduce the number of syscall invocations from within the kernel. This series is focused solely on the net/ part of the kernel and get rids of syscall and compat_syscall invocations from within the kernel completely. It is also available at

https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git syscalls-net-next

The rationale of this change is described in patch 1 of part 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.

At present, these patches are based on v4.16-rc5; there is one trivial conflict against net-next. Dave, I presume that you prefer to take them through net-next? If you want to, I can re-base them against net-next. If you prefer otherwise, though, I can route them as part of my whole syscall series.

Thanks,
Dominik

[*] The cover letter for v2 is available at
http://lkml.kernel.org/r/[email protected] ; the whole patchset -- in its current, slightly modified form -- is available at at https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git syscalls-next

Dominik Brodowski (22):
net: socket: add __sys_recvfrom() helper; remove in-kernel call to
syscall
net: socket: add __sys_sendto() helper; remove in-kernel call to
syscall
net: socket: add __sys_accept4() helper; remove in-kernel call to
syscall
net: socket: add __sys_socket() helper; remove in-kernel call to
syscall
net: socket: add __sys_bind() helper; remove in-kernel call to syscall
net: socket: add __sys_connect() helper; remove in-kernel call to
syscall
net: socket: add __sys_listen() helper; remove in-kernel call to
syscall
net: socket: add __sys_getsockname() helper; remove in-kernel call to
syscall
net: socket: add __sys_getpeername() helper; remove in-kernel call to
syscall
net: socket: add __sys_socketpair() helper; remove in-kernel call to
syscall
net: socket: add __sys_shutdown() helper; remove in-kernel call to
syscall
net: socket: add __sys_setsockopt() helper; remove in-kernel call to
syscall
net: socket: add __sys_getsockopt() helper; remove in-kernel call to
syscall
net: socket: add do_sys_recvmmsg() helper; remove in-kernel call to
syscall
net: socket: move check for forbid_cmsg_compat to __sys_...msg()
net: socket: replace calls to sys_send() with __sys_sendto()
net: socket: replace call to sys_recv() with __sys_recvfrom()
net: socket: add __compat_sys_recvfrom() helper; remove in-kernel call
to compat syscall
net: socket: add __compat_sys_setsockopt() helper; remove in-kernel
call to compat syscall
net: socket: add __compat_sys_getsockopt() helper; remove in-kernel
call to compat syscall
net: socket: add __compat_sys_recvmmsg() helper; remove in-kernel call
to compat syscall
net: socket: add __compat_sys_...msg() helpers; remove in-kernel calls
to compat syscalls

 include/linux/socket.h |  37 +++++++-
 net/compat.c           | 136 +++++++++++++++++++---------
 net/socket.c           | 234 ++++++++++++++++++++++++++++++++++---------------
 3 files changed, 291 insertions(+), 116 deletions(-)
Signature · 1 line
2.16.2