Received: by 10.213.65.68 with SMTP id h4csp980556imn; Sun, 18 Mar 2018 09:36:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELtx6/Y98zSwTJYE8AwIKQ20JlNH7jCi0E0bAXt2oVtJenp1HCQ4xeDmsKYk2dHg6YxsSANi X-Received: by 10.99.190.5 with SMTP id l5mr5240306pgf.25.1521391003530; Sun, 18 Mar 2018 09:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521391003; cv=none; d=google.com; s=arc-20160816; b=gOBJA2lxAHkCy6b2HeUlv98TyPf0C62H+5HIOiD2uquXX7740HrOuhuL0Jud/ieT9k dczy31TSQoKD9iGLUq93aeTT+6FATu6/0JWpzAefMiXsvUMZD207DUaNP5El6Mq3SAb9 C+nZHRoibXL7jvVyz9CKReX9Zg9kr5myDiMzsSMAy2XErgBgIFVYe7ML4Uu42cat2wUF NychZdeKOxYqlqKQIRZobhjIhmigRB9a61NDkZXPSBgycYi5ZtTuSq2LlMCoonBZvJbR QKWA80ftrASeIZwJTItj3DHGulPS6oLg/Qdn77IhMCYFpaRIdMX9jYQF7Me2UJoEzJU3 vK/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EeM54JqDfaQF8pDAcyo2gXoRLYlwmAGQOwnbfGJuLMg=; b=Y5VEp2ZFW0jf7yjNK3OBGsv9lRlPrTDi0eM+aPEpGh5yj77Fw9H/Uc0m0wUzEIRaKS O0XW1N4KkDbY27W6pgHyewK7J0bmP605C74FCd611BFEd9CiwFEe3VdG2lCt36AX7lzh sKpMKapAXXgxGHLdtsQuLbDubFyOhi6Pk4wxHR8a0is4Y2VQrcW+lRwnVNNPZPgdfNnt abRX2xYKOJvifPgapG3XTI8NNGJOxfku3JKiHvkbk6NltXtwtUu+cLUDeQz4nKpiaF23 eWqstHKNpdDC8NN898KyJuLL2/zpRfd7Aafo01ogkZF7zff6Vq/DArAWNi7vK5vKDeLs eBcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si8056008pgq.535.2018.03.18.09.36.16; Sun, 18 Mar 2018 09:36:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754706AbeCRQMH (ORCPT + 99 others); Sun, 18 Mar 2018 12:12:07 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:46484 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754157AbeCRQL7 (ORCPT ); Sun, 18 Mar 2018 12:11:59 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id AF2F92008FF; Sun, 18 Mar 2018 16:11:57 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id B5ACC20CA1; Sun, 18 Mar 2018 17:11:10 +0100 (CET) From: Dominik Brodowski To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, arnd@arndb.de, viro@ZenIV.linux.org.uk Cc: linux-arch@vger.kernel.org Subject: [RFC PATCH 0/6] remove in-kernel syscall invocations (part 3 == compat cruft) Date: Sun, 18 Mar 2018 17:10:50 +0100 Message-Id: <20180318161056.5377-1-linux@dominikbrodowski.net> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.16.2