Skip to content

RFC remove in-kernel syscall invocations (part 3 == compat cruft)

Dominik Brodowski linux-arch linux-mips linux-s390 linuxppc-dev lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fs: provide a generic compat_sys_fallocate() implementationarch/mips/include/asm/unistd.h arch/mips/kernel/linux32.c arch/mips/kernel/scall64-o32.S +15 more+41 -450 replies
2/6fs: provide a generic compat_sys_truncate64() implementationarch/mips/include/asm/unistd.h arch/mips/kernel/linux32.c arch/mips/kernel/scall64-o32.S +16 more+49 -433 replies
3/6fs: provide generic compat_sys_p{read,write}64() implementationsarch/mips/include/asm/unistd.h arch/mips/kernel/linux32.c arch/mips/kernel/scall64-o32.S +16 more+97 -1062 replies
4/6mm: provide generic compat_sys_readahead() implementationarch/mips/include/asm/unistd.h arch/mips/kernel/linux32.c arch/mips/kernel/scall64-o32.S +15 more+76 -6321 replies
5/6x86: use _do_fork() in compat_sys_x86_clone()arch/x86/ia32/sys_ia32.c+2 -10 replies
6/6x86: remove compat_sys_x86_waitpid()arch/x86/entry/syscalls/syscall_32.tbl arch/x86/ia32/sys_ia32.c arch/x86/include/asm/sys_ia32.h+1 -100 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/6] remove in-kernel syscall invocations (part 3 == compat cruft)

Here is a third series of patches which reduce the number of syscall invocations from within the kernel. Once this long-term goal is achieved, the syscall entry path can be streamlined.

This series focuses on a few compat syscall definitions in arch/ which have no other in-kernel users. In particular, it introduces generic compat syscalls for a handful of mm- and fs-related functions. Their calling convention depends on whether the architecture sets
__ARCH_WANT_LE_COMPAT_SYS (little-endian calling convention)
and/or __ARCH_WANT_COMPAT_SYS_WITH_PADDING.

As I am not used to non-x86 architectures, please bear with me in case I broke something or missed some peculiarities. In particular, I was surprised that a couple of compat syscall definitions used "u64" or "unsigned long" as parameter definitions -- though the code makes it clear that they expected an "u32" or an "unsigned int" instead. CVE-2009-0029 seems to be handled already by the compat_sys_*() compat_SyS_*() / C_SYSC_*() indirection provided for by include/linux/compat.h. Or do I miss something here?

I did not bother addressing metag and tile, as they are going away. Parisc and sh (sys_sh32.c in particular) provide similar wrappers for "native" (non-compat) use, so they are left as-is as well.

Patches 5 and 6 in this series are x86-only.

Thanks,
Dominik

Dominik Brodowski (6):
fs: provide a generic compat_sys_fallocate() implementation
fs: provide a generic compat_sys_truncate64() implementation
fs: provide generic compat_sys_p{read,write}64() implementations
mm: provide generic compat_sys_readahead() implementation
x86: use _do_fork() in compat_sys_x86_clone()
x86: remove compat_sys_x86_waitpid()

 arch/mips/include/asm/unistd.h         |  8 ++++
 arch/mips/kernel/linux32.c             | 35 ---------------
 arch/mips/kernel/scall64-o32.S         | 10 ++---
 arch/powerpc/include/asm/unistd.h      |  5 +++
 arch/powerpc/kernel/sys_ppc32.c        | 30 -------------
 arch/s390/include/asm/unistd.h         |  4 ++
 arch/s390/kernel/compat_linux.c        | 33 --------------
 arch/s390/kernel/compat_linux.h        |  5 ---
 arch/s390/kernel/syscalls/syscall.tbl  | 10 ++---
 arch/sparc/include/asm/unistd.h        |  4 ++
 arch/sparc/kernel/sys_sparc32.c        | 41 -----------------
 arch/sparc/kernel/systbls.h            | 19 --------
 arch/sparc/kernel/systbls_64.S         |  4 +-
 arch/x86/entry/syscalls/syscall_32.tbl | 12 ++---
 arch/x86/ia32/sys_ia32.c               | 46 +------------------
 arch/x86/include/asm/sys_ia32.h        | 14 ------
 arch/x86/include/asm/unistd.h          |  5 +++
 fs/open.c                              | 52 +++++++++++++++++++++-
 fs/read_write.c                        | 74 +++++++++++++++++++++++++++++--
 include/linux/compat.h                 | 42 ++++++++++++++++++
 mm/readahead.c                         | 81 ++++++++++++++++++++++++----------
 21 files changed, 266 insertions(+), 268 deletions(-)
Signature · 1 line
2.16.2