From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224TxPILMA7tAJ2MOPYsWZXzn72RqLPmkL+JDfH82IQx45A7IFDoGNUWIBrI9/rgv4WfsWza ARC-Seal: i=1; a=rsa-sha256; t=1517164760; cv=none; d=google.com; s=arc-20160816; b=kNkYXD1BG06hDYTdYEGyS0ZVmo7EEevlGyb9NYzDKMi/l77uxF1uiogh82eE2al8qf sHmpSzDM9togfDHRh3bLcA8DGqPIWp+iZGHIKj3/2dT12hhbIIi4SYk2C65N3B2kpHjp f1oskp7sJrCED54G72ZoLCud5mw1qytLuU0tDZyow7zkoE9DX9GkB/oZHjGg89wroKyr C7JaCVcr/uhYevW2UMBwFCRAyDIUu60mwiua8tfanN7HWOkizBJv9EMd2Aa/goYPplN7 bTLlKyHulAR5+R4FDLKa/4xQ8x6PNZx6F6rgTzoukFLjIQK43q9iXNphyYDt9qzPiJub dqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:references:in-reply-to:references:in-reply-to:message-id :date:cc:to:from:dmarc-filter:delivered-to:list-id:list-subscribe :list-unsubscribe:list-help:list-post:precedence:mailing-list :arc-authentication-results; bh=4mqgKhNeH5B169m5gqo1ZikQPzm2uNA3tqV92wc+voQ=; b=Jtb2ifIQtIasg0dfGbWi12LMv9NNMzFrxA5lU9bLoxUF7bE9byMxoSYTHQPMxYOnaU D8k8+dKq1E1wKj5p4MovquKFdZrt+vBWveD4LkoLftDdyXsSRW4LQchqgR7BBOCQdmLd FN0UrRjY/jVYaKVoqSL9ry8s7m64tLXMmBf8T1rAFPomxw52pNhk5scwCUG6kQrF6IK7 QbXRsB/lu63IZDzsXfNXFuhW4x3QQOpInjztdNmip+u380JLeQO3lfSpZnx8QtaXuShs ZQthLQY2thoRqb4Sit9KG/46b+ctqcKG2Q9brRz9UFNhUMXn9ryos4fR0CMtxzivoV/v tGJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of kernel-hardening-return-11489-gregkh=linuxfoundation.org@lists.openwall.com designates 195.42.179.200 as permitted sender) smtp.mailfrom=kernel-hardening-return-11489-gregkh=linuxfoundation.org@lists.openwall.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of kernel-hardening-return-11489-gregkh=linuxfoundation.org@lists.openwall.com designates 195.42.179.200 as permitted sender) smtp.mailfrom=kernel-hardening-return-11489-gregkh=linuxfoundation.org@lists.openwall.com Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590862555674165882?= X-GMAIL-MSGID: =?utf-8?q?1590862555674165882?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: __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)))); \ -- 2.14.3