Received: by 10.192.245.15 with SMTP id i15csp926159imn; Sat, 10 Mar 2018 12:57:06 -0800 (PST) X-Google-Smtp-Source: AG47ELvYiGNLNzbwXnZVxERjuGyHMJvAJ3bnh1q1u12YwOOppT9nwPlptNB65scUXSqy+yMvEU2h X-Received: by 10.98.62.196 with SMTP id y65mr2963940pfj.24.1520715426446; Sat, 10 Mar 2018 12:57:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520715426; cv=none; d=google.com; s=arc-20160816; b=gyqs9YdtCSMVosjYe+DLI1g2lzrTbUAeHeqpkH0xK56PNEsDwVTMtHMFhQVUe0PPD2 Vdg3L9tXPyTVzrm01j5SmaYcaIlxpKMQMQwOCQc/1TESivyVl+EiZ7pwjYhsjUQrHr2n GTcdTQCT0kUQEOH0T3GHe7fxPWn0IwVPeh/IWf1057MMh2XX+yEQda4OoC8p1ABdhBAc CR1bdgE9HU9p9lZdRvV7uBxP7sJGVWqgOYtY0iRQv9V1wtHzwiGFA4TbrPx0gFVWj9Tr 4/qd6+DNFQMEgXJMqzAfW3fU0LeZRR/JCjkPOw/AQCvWkMhfbnAf4cFx4qUizQTCbWLV nY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=6E9+s+i3iULKI8yraNa5mWiNPy+djnbyeuiHnDpNqso=; b=Nzf2Klx0WYvyzaObSDVB32ktsmM+NT/RRz2iuAnReETcObrHIIRiX+8utvAwAza7Pd DG3N/zG8gZfzNSeCIesXSiOh5bIeeROq81ov4DWi5MZgEXyjvhwPmwikdiFVK8NMYE3I 3jyh/GbuHn7qfe5j6Brdo0jl1ngXB6EGoYSolhjgdPhHGst/nf4GCz9EFqqnEMuS4G50 c6pbwixPM6nHml5I2vQ3hP21IDxEPBQlIT12f7p7L+aeEhb3kJK+5oB4FdvV0Y6fWwuB XId9yM15A5Ncc0XZ16OZI4mkltyhXjfToTxUx+HwXYJN3bJPbiYBNzf/fP+jntqfFR8c n9nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=SlzQszhd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j63si961458pgc.445.2018.03.10.12.56.50; Sat, 10 Mar 2018 12:57:06 -0800 (PST) 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; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=SlzQszhd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190AbeCJUzz (ORCPT + 99 others); Sat, 10 Mar 2018 15:55:55 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:42080 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbeCJUzx (ORCPT ); Sat, 10 Mar 2018 15:55:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt; s=amazon201209; t=1520715353; x=1552251353; h=from:to:cc:subject:date:message-id:content-id: mime-version:content-transfer-encoding; bh=6E9+s+i3iULKI8yraNa5mWiNPy+djnbyeuiHnDpNqso=; b=SlzQszhdS7msJxHnyLiZmQCG1bYYxjbNLpxUBYjV+4OSiKQ4yX39pybx 0Gkhfa+tJIbz/5EsUS3UV7lsR7cFDpo474BBGfi6FT0z8aUovoK86+T6y 3T7KhJQeTKCjxvLQ+IKi17G11i1VMQ1x/nD5bQx1j/hn7O0oFktorEkDL o=; X-IronPort-AV: E=Sophos;i="5.47,452,1515456000"; d="scan'208";a="670141726" Received: from iad6-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com) ([10.124.125.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Mar 2018 20:55:51 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w2AKtjYF107847 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sat, 10 Mar 2018 20:55:48 GMT Received: from EX13D02EUB002.ant.amazon.com (10.43.166.170) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sat, 10 Mar 2018 20:55:47 +0000 Received: from EX13D02EUB001.ant.amazon.com (10.43.166.150) by EX13D02EUB002.ant.amazon.com (10.43.166.170) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sat, 10 Mar 2018 20:55:46 +0000 Received: from EX13D02EUB001.ant.amazon.com ([10.43.166.150]) by EX13D02EUB001.ant.amazon.com ([10.43.166.150]) with mapi id 15.00.1236.000; Sat, 10 Mar 2018 20:55:46 +0000 From: "Tautschnig, Michael" To: "x86@kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jaswinder Singh , Andi Kleen Subject: [PATCH] x86: always use SYSCALL_DEFINE* Thread-Topic: [PATCH] x86: always use SYSCALL_DEFINE* Thread-Index: AQHTuLIp4kJZlR4voUmoYns5SdXQ2A== Date: Sat, 10 Mar 2018 20:55:46 +0000 Message-ID: <14A5C8D0-3F9D-486F-A20C-55849D70FC80@amazon.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.165.246] Content-Type: text/plain; charset="us-ascii" Content-ID: <91976A686E6EEE4DB3F549E4F8BBBB3C@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All syscall arguments are passed in as types of the same byte size as unsigned long (width of full registers). Using a smaller type without a cast may result in losing bits of information. SYSCALL_DEFINE* introduce adequate type casts. All definitions of syscalls in x86 except for those patched here have already been using the appropriate SYSCALL_DEFINE*. Signed-off-by: Michael Tautschnig Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Cc: Jaswinder Singh Cc: Andi Kleen --- arch/x86/kernel/ioport.c | 3 ++- arch/x86/kernel/signal.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 2f72330..d98b2a3 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -23,7 +23,8 @@ /* * this changes the io permissions bitmap in the current task. */ -asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn= _on) +SYSCALL_DEFINE3(sys_ioperm, unsigned long, from, unsigned long, num, int, + turn_on) { struct thread_struct *t =3D ¤t->thread; struct tss_struct *tss; diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index b9e00e8..40ba242 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -601,7 +602,7 @@ static int x32_setup_rt_frame(struct ksignal *ksig, * Do a signal return; undo the signal stack. */ #ifdef CONFIG_X86_32 -asmlinkage unsigned long sys_sigreturn(void) +SYSCALL_DEFINE0(sigreturn) { struct pt_regs *regs =3D current_pt_regs(); struct sigframe __user *frame; @@ -633,7 +634,7 @@ asmlinkage unsigned long sys_sigreturn(void) } #endif /* CONFIG_X86_32 */ -asmlinkage long sys_rt_sigreturn(void) +SYSCALL_DEFINE0(rt_sigreturn) { struct pt_regs *regs =3D current_pt_regs(); struct rt_sigframe __user *frame; -- 2.7.3.AMZN Amazon Web Services UK Limited. Registered in England and Wales with regist= ration number 08650665 with its registered office at 1 Principal Place, Wor= ship Street, London, EC2A 2FA, United Kingdom.