Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1599606ybh; Mon, 20 Jul 2020 02:26:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR6y1zH8IRaY5gt42S/iamZ4TwCLeQm/aKaTDpbikCF+IZpVCFfX/cV3JgT+DF2waeFFkG X-Received: by 2002:a17:906:a055:: with SMTP id bg21mr19768576ejb.516.1595237211497; Mon, 20 Jul 2020 02:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595237211; cv=none; d=google.com; s=arc-20160816; b=xl30kMtTkdy+ijlbWjev7SywhwRm81btx9PUbh7mhi7asqmc6PSMce6Vrp9z2BQsZH K5Y5dZh3O2SZfhdQsgyFfFK4/XJF+4c6xcQZbBZo4vgvoXnbR6ayamAun6kD5EbJ4y9T icDDrjz5FyboXGAr/NLTxc+fpGFCptDTo8vpmzZETjcB2DPAEI7UA98sg0GHqJk36DD+ YBahrmAC1obO8QRxhNSFNcvYphSOYTpygTn4IqMKFPT0jRqf/wW2GIb7qcjnHzIufeL6 W3MuGgrQQfq4PAd0IzD7nB5PdS4O1FPzOffmi/bvYD4l2m3Q4BuUuBMFUdjmS6ytT1u6 2ANg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NJBgJeze5Mjokdsv2fUmLmnOx5lPenD1DYlXM8BrNDM=; b=VnMV+vDOZmPDk3O6Ebm5Rk/Deu8LNeoHu2qhED5ak8Zp/qzfTtE4RKITR20/z0lSkc Wv2zasVQGplljmzRRIkBqGX9aYBneikLUKHrUNZAfIajaWVhHbR/fDs44KskpqyzqIBo XOe6or+LcBRcatvsWCpF2spZM14DBU9FSGZwj965NGpqjkVqXxBEjaB9L23eK2jemYFO sXQjnxiK7bmGF0x4pH62ekntW9tmUria+HBkm0UrjiplwztzAy+s41r+H4L/UfpepUb7 W4PLhvB1zuPlt4h0xRTf4dDdDsy2E2CwASPUhH6VIgcf6ogmKPCNifjsUILBJYUYpeNJ aThw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="R/sQXHHf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si9840993edl.202.2020.07.20.02.26.28; Mon, 20 Jul 2020 02:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="R/sQXHHf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728302AbgGTJZp (ORCPT + 99 others); Mon, 20 Jul 2020 05:25:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:39570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbgGTJZo (ORCPT ); Mon, 20 Jul 2020 05:25:44 -0400 Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B51821775; Mon, 20 Jul 2020 09:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595237144; bh=YMyAfjljQc8EzCHFIHsxaCYd3kRBN7HbarnPGa14M7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/sQXHHftzERFhSX4qe/uBjqX1PQydghDLSbhQH84dS6AvDOZYJNhqdbcctYhKHqy 6yHeLNt65hm5HlvIwNeOGGFk12IFwzl/x/ngBS/kMGJK7lUlQ9BMmqxPT158JLP1sj unUTxs6WPJwzX9HI1Y8+tYlm3Cv1r1fkKGph/VT0= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexander Viro , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Idan Yaniv , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mike Rapoport , Mike Rapoport , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH 4/6] arch, mm: wire up secretmemfd system call were relevant Date: Mon, 20 Jul 2020 12:24:33 +0300 Message-Id: <20200720092435.17469-5-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200720092435.17469-1-rppt@kernel.org> References: <20200720092435.17469-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport Wire up secretmemfd system call on architectures that define ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86. Signed-off-by: Mike Rapoport --- arch/arm64/include/asm/unistd32.h | 2 ++ arch/arm64/include/uapi/asm/unistd.h | 1 + arch/riscv/include/asm/unistd.h | 1 + arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + include/linux/syscalls.h | 1 + include/uapi/asm-generic/unistd.h | 7 ++++++- 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 6d95d0c8bf2f..f9e00baa67f5 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -885,6 +885,8 @@ __SYSCALL(__NR_openat2, sys_openat2) __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) #define __NR_faccessat2 439 __SYSCALL(__NR_faccessat2, sys_faccessat2) +#define __NR_secretmemfd 439 +__SYSCALL(__NR_secretmemfd, sys_secretmemfd) /* * Please add new compat syscalls above this comment and update diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h index f83a70e07df8..f2693f05fc80 100644 --- a/arch/arm64/include/uapi/asm/unistd.h +++ b/arch/arm64/include/uapi/asm/unistd.h @@ -20,5 +20,6 @@ #define __ARCH_WANT_SET_GET_RLIMIT #define __ARCH_WANT_TIME32_SYSCALLS #define __ARCH_WANT_SYS_CLONE3 +#define __ARCH_WANT_SECRETMEMFD #include diff --git a/arch/riscv/include/asm/unistd.h b/arch/riscv/include/asm/unistd.h index 977ee6181dab..9e47d9aed5eb 100644 --- a/arch/riscv/include/asm/unistd.h +++ b/arch/riscv/include/asm/unistd.h @@ -9,6 +9,7 @@ */ #define __ARCH_WANT_SYS_CLONE +#define __ARCH_WANT_SECRETMEMFD #include diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index d8f8a1a69ed1..7b91a932ed13 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -443,3 +443,4 @@ 437 i386 openat2 sys_openat2 438 i386 pidfd_getfd sys_pidfd_getfd 439 i386 faccessat2 sys_faccessat2 +440 i386 secretmemfd sys_secretmemfd diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 78847b32e137..9cddea4ec1ce 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -360,6 +360,7 @@ 437 common openat2 sys_openat2 438 common pidfd_getfd sys_pidfd_getfd 439 common faccessat2 sys_faccessat2 +440 common secretmemfd sys_secretmemfd # # x32-specific system call numbers start at 512 to avoid cache impact diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b951a87da987..8fe242fc70ea 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1005,6 +1005,7 @@ asmlinkage long sys_pidfd_send_signal(int pidfd, int sig, siginfo_t __user *info, unsigned int flags); asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags); +asmlinkage long sys_secretmemfd(unsigned long flags); /* * Architecture-specific system calls diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index f4a01305d9a6..aadaf25cbf5a 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -858,8 +858,13 @@ __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) #define __NR_faccessat2 439 __SYSCALL(__NR_faccessat2, sys_faccessat2) +#ifdef __ARCH_WANT_SECRETMEMFD +#define __NR_secretmemfd 440 +__SYSCALL(__NR_secretmemfd, sys_secretmemfd) +#endif + #undef __NR_syscalls -#define __NR_syscalls 440 +#define __NR_syscalls 441 /* * 32 bit systems traditionally used different -- 2.26.2