Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp180425pxa; Tue, 4 Aug 2020 02:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE4sk6XtO0sYdUqppIuq2hngw3qFOb87Hf+wwfbzDyD7e5xsCg6SRmGrZDeCWNiztWtTO8 X-Received: by 2002:a17:906:3790:: with SMTP id n16mr20209179ejc.256.1596534734551; Tue, 04 Aug 2020 02:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596534734; cv=none; d=google.com; s=arc-20160816; b=Za6ljWW+YvRxJbryndrlauu9q7i53ZJ5BQ1ZOZ0ni+Jex35pVtbRNQvcvF1VQe4MyO kyNe7rf6WEEcw3scZ3tlqv40gtskP8Chbup8WTSQteBVebf2OY9rWW+o2yd1bHFMOFbS WdxNnACT1CLSa0rMojC0ePJz3Pd2Nr4l4YOXfBHIyDAwGvRXGPBCvoUhu/H/YvkvcU4I TMVRzb//XYgotqd26jijKZh6Wr2eP3BckTzZlmFf4cznQMnkTcZvvHWlmihysrs6StsJ v3eC80zoG+fVcPFsoS09iRaGA76y80nvWtmMej5RLOoykzsFQfh4MVw4q4sXGwxbt2km YIqg== 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=i10zBfPWXe3k3QJx3RbifFC4GPyXHuh4x45O0etHqgM=; b=XDnTvbfDXjp2QuJGigoF5QA0c39e4yApYArpw+mD7rUfYti0CgxdUH8+cFUEu9sk/O fBcft7C8LeM85USxE+tt/CF7bkBLWrzsFnrnWxDMTK2mD6af3+IOSjQzqQ5MQUCsv7vy qLMnMl9UtFKsrLKZldNxa7VfIe5QCEpS6anxPcsh8GpcyejRVQH2MP7n9fPlMGac83eM VqC2YKp/XqYl0Nmba436jimoM4+sWUxOVK/91qZYb/BZmwZ2ZP0k93Yhw0f5715DyhA2 XWOeHC3QruTNa6tETXxfWA3dFcYIe11ujlFBwUOA57cRzJ5F0Mv10FGRT7qTL4rwLsnG jmAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DOAz2xnk; 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 k10si12804397ejr.155.2020.08.04.02.51.52; Tue, 04 Aug 2020 02:52:14 -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=DOAz2xnk; 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 S1729961AbgHDJv0 (ORCPT + 99 others); Tue, 4 Aug 2020 05:51:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:46374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgHDJv0 (ORCPT ); Tue, 4 Aug 2020 05:51:26 -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 8BAB8206DA; Tue, 4 Aug 2020 09:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596534685; bh=r3t4v9zzG8VLdzS6wGyezAn51/RhQzyxGikcEYKDlSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOAz2xnk75CPIM0JBgwUbng7nSMz4ytAY0sw3rTGaBnOYNBorqh5ypPIMXdYfEab8 uYuHG+nTnxk6NAylbbH0Sn0MUoX7eICNkyvLNZvs3wGG6S1W8IksdI1OfZm3QwkuBr hcAtxRHyTtx907zC1fU31YR9T0fqtrr7OYYi3/JM= 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 , Mark Rutland , Mike Rapoport , Mike Rapoport , Michael Kerrisk , 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, Palmer Dabbelt Subject: [PATCH v3 4/6] arch, mm: wire up memfd_secret system call were relevant Date: Tue, 4 Aug 2020 12:50:33 +0300 Message-Id: <20200804095035.18778-5-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200804095035.18778-1-rppt@kernel.org> References: <20200804095035.18778-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 memfd_secret system call on architectures that define ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86. Signed-off-by: Mike Rapoport Acked-by: Palmer Dabbelt Acked-by: Arnd Bergmann --- arch/arm64/include/asm/unistd.h | 2 +- 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 ++++++- 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 3b859596840d..b3b2019f8d16 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -38,7 +38,7 @@ #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 440 +#define __NR_compat_syscalls 441 #endif #define __ARCH_WANT_SYS_CLONE diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 6d95d0c8bf2f..3d9c3a3012db 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_memfd_secret 440 +__SYSCALL(__NR_memfd_secret, sys_memfd_secret) /* * 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..ce2ee8f1e361 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_MEMFD_SECRET #include diff --git a/arch/riscv/include/asm/unistd.h b/arch/riscv/include/asm/unistd.h index 977ee6181dab..6c316093a1e5 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_MEMFD_SECRET #include diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index d8f8a1a69ed1..6f8b5978053b 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 memfd_secret sys_memfd_secret diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 78847b32e137..7d3775d1c3d7 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 memfd_secret sys_memfd_secret # # 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..e4d7b30867c6 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_memfd_secret(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..7b288347c5a9 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_MEMFD_SECRET +#define __NR_memfd_secret 440 +__SYSCALL(__NR_memfd_secret, sys_memfd_secret) +#endif + #undef __NR_syscalls -#define __NR_syscalls 440 +#define __NR_syscalls 441 /* * 32 bit systems traditionally used different -- 2.26.2