From patchwork Sun Jan 28 18:38:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 10187927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0010560384 for ; Sun, 28 Jan 2018 18:39:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2AC028697 for ; Sun, 28 Jan 2018 18:39:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D610B286FD; Sun, 28 Jan 2018 18:39:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 208B128709 for ; Sun, 28 Jan 2018 18:39:10 +0000 (UTC) Received: (qmail 9252 invoked by uid 550); 28 Jan 2018 18:39:08 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 8155 invoked from network); 28 Jan 2018 18:39:07 -0000 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 551E1217A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org From: Andy Lutomirski To: x86@kernel.org, LKML Cc: Linus Torvalds , Kernel Hardening , Borislav Petkov , Andy Lutomirski Date: Sun, 28 Jan 2018 10:38:51 -0800 Message-Id: <4dd5a4d0f6b694f17eaf64c80c36a2560993b9ea.1517164461.git.luto@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Subject: [kernel-hardening] [PATCH 3/3] syscalls: Add a bit of documentation to __SYSCALL_DEFINE X-Virus-Scanned: ClamAV using ClamSMTP __SYSCALL_DEFINE is rather magical. Add a bit of documentation. Signed-off-by: Andy Lutomirski --- include/linux/syscalls.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a78186d826d7..d3f244a447c5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -207,6 +207,16 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) + +/* + * For a syscall like long foo(void *a, long long b), this defines: + * + * static inline long SYSC_foo(void *a, long long b): the actual code + * + * asmlinkage long SyS_foo(long a, long long b): wrapper that calls SYSC_foo + * + * asmlinkage long sys_foo(void *a, long long b): alias of SyS_foo + */ #define __SYSCALL_DEFINEx(x, name, ...) \ asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ __attribute__((alias(__stringify(SyS##name)))); \