Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2234293ybi; Thu, 20 Jun 2019 11:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnSOEj4Nl8fMR3pTPJIfc05qNoBZbSJuS8F3siwuvQSx1CxrG99iVkskOKnt2Qz50QtUNN X-Received: by 2002:aa7:9212:: with SMTP id 18mr93406591pfo.120.1561054773031; Thu, 20 Jun 2019 11:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054773; cv=none; d=google.com; s=arc-20160816; b=G7Gc9ZpZvemx5riBVWoHWZZ5ORqwzsxrCJQRvBnGJooQksDvpHKUdMCr41fLJvwuuj T8A2y6++pQpbSbtUvEghc39PhQWUG9UiEDdlSqZ1KZq4iqeCYjC9ILKFtfOjiCePp2dV E9682Si5OVBKn8056mf1QRsSg+7VSx07MSsV+Pz99Y3TRfCnsFXPk33vPh+OOPVs3PIG qAi+Qk99ArY6YSF9yrI8FMXI0HuM16ulKCjk4fEkViTLo/HiBuFQ6359Ue2BzFTKJRnD 7DlbpvsSkDdPaM/UXaMiAdq6pOSgfWPoI8uqom1x/cOIpmrfHtICPC8V+tWz/hogowyG RchQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kegOQZEV6Gx8eJc5QHfRAthLjpXwCWZXZ8APGtoNRww=; b=UXE64MyOIZWck4iJdqQoqkeXsvuvfQxO3E87gq8MXPznEWYFBhZLqfr8SIzfXWPrUr lIFw9WB7Mx5MVLiRwnXqp/V+LjU1pMXEx8PdjfYX0oW59X0Fxg7SU00B3Q3QjlxlDgRM dwS1tsvQU2MeFgjAVVERifr0s8fUeHhVkkxQcq4WFoqjqHikT5KFT/H7iGpl9uH8LVXy Ny1ph2yN8DoP3dsC9pH2hWvZ3jQIU1VzAZTYvt70UwpbCTE6ggV87wGFgwzOhm/W7duS nLwyczfNsi45yy3bO/AHKr2kCoDnHubOPePLPsHZaEzu+yqRG8pvSr3drZAJZPOOjacm CDJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jKsiPBJ6; 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 b3si180513pgd.243.2019.06.20.11.19.18; Thu, 20 Jun 2019 11:19:33 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jKsiPBJ6; 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 S1729609AbfFTSR7 (ORCPT + 99 others); Thu, 20 Jun 2019 14:17:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:46756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729474AbfFTSR0 (ORCPT ); Thu, 20 Jun 2019 14:17:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E55C20675; Thu, 20 Jun 2019 18:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054645; bh=9TlGhu5PE6MnakiwtG3u2ciQ4gIz2gyIJSShFYv6hJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jKsiPBJ6i78iekpM7CRyt1RsSOKST8P6EF/s0D3tjecdQzug6G4E92NW7lwE7ZSBt DNoZ3+qj6/NJha8qWEubpniL2zmKH8MSTVA3KtkPiPTKEVycl4zGKvHpmdpsa9SvAf /SZHJS8Z9KVYQlvUFX6w3kSEoD92qH/kPMO3BcAM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sami Tolvanen , Will Deacon , Sasha Levin Subject: [PATCH 5.1 80/98] arm64: use the correct function type in SYSCALL_DEFINE0 Date: Thu, 20 Jun 2019 19:57:47 +0200 Message-Id: <20190620174353.308223420@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 0e358bd7b7ebd27e491dabed938eae254c17fe3b ] Although a syscall defined using SYSCALL_DEFINE0 doesn't accept parameters, use the correct function type to avoid indirect call type mismatches with Control-Flow Integrity checking. Signed-off-by: Sami Tolvanen Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/include/asm/syscall_wrapper.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h index a4477e515b79..507d0ee6bc69 100644 --- a/arch/arm64/include/asm/syscall_wrapper.h +++ b/arch/arm64/include/asm/syscall_wrapper.h @@ -30,10 +30,10 @@ } \ static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) -#define COMPAT_SYSCALL_DEFINE0(sname) \ - asmlinkage long __arm64_compat_sys_##sname(void); \ - ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \ - asmlinkage long __arm64_compat_sys_##sname(void) +#define COMPAT_SYSCALL_DEFINE0(sname) \ + asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused); \ + ALLOW_ERROR_INJECTION(__arm64_compat_sys_##sname, ERRNO); \ + asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused) #define COND_SYSCALL_COMPAT(name) \ cond_syscall(__arm64_compat_sys_##name); @@ -62,11 +62,11 @@ static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) #ifndef SYSCALL_DEFINE0 -#define SYSCALL_DEFINE0(sname) \ - SYSCALL_METADATA(_##sname, 0); \ - asmlinkage long __arm64_sys_##sname(void); \ - ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \ - asmlinkage long __arm64_sys_##sname(void) +#define SYSCALL_DEFINE0(sname) \ + SYSCALL_METADATA(_##sname, 0); \ + asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused); \ + ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO); \ + asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused) #endif #ifndef COND_SYSCALL -- 2.20.1