From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCF3DC43600 for ; Fri, 14 May 2021 09:27:57 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B4976141F for ; Fri, 14 May 2021 09:27:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B4976141F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 05372100EAB0C; Fri, 14 May 2021 02:27:56 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=david@redhat.com; receiver= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 59937100EAB09 for ; Fri, 14 May 2021 02:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620984473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lCFOeXXuHqZj/3n5W4PkDf5UJ0V8NO/Y5/poalLCeQU=; b=doEV/osVmgQ4E2qonk1MwbTRonAvztAxV0UpO6phcTOAXqfbH1NKOqZfCEHk9x2lVnOk2o csEOklxirAkGqsic5gcu/kDbCb5LToyo6pIxnlri6tuqCqPr/HC7oMpdZUdKA6QS0g9mMF u8gUE53evgj+umwiX02/idBTe9U3534= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-wbQtjLUtP02PELpDNB5Otg-1; Fri, 14 May 2021 05:27:51 -0400 X-MC-Unique: wbQtjLUtP02PELpDNB5Otg-1 Received: by mail-ej1-f72.google.com with SMTP id p25-20020a1709061419b0290378364a6464so9387755ejc.15 for ; Fri, 14 May 2021 02:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=lCFOeXXuHqZj/3n5W4PkDf5UJ0V8NO/Y5/poalLCeQU=; b=kBL+CXZ/UnNct+x4U/x/dgD59wYFWsfcft9XU7OGK7DAkEzd7eUxp1gxhVJPPyDWqf dK6N/9pqPrqdZaFB8FS/zdwHx6jd9mEjgo3sRSSJFkIzx4/k2MhWwU2OcwlAsvnmhTMX ULfR423Q+mZZ7HxGMwXmWY7GUz+MazdFPOCxLPhP5olkzmpIFwb8TjK3+3vvkP8lVaLi OKvILWa5S4x2zxZOKOfOgzUSsaFBCYZzaOLvB7fmoOGEGToZoR7A1516F5yp579aI1FU wVwNtWeYtP5+AYB8PlFVkwj7kKkBli6OyMPo3uoPfW4fJKBQEFucuARhdiezaLkWc/eh 2dyA== X-Gm-Message-State: AOAM532o997ra2eY545H2QPFhu9BFCgzYYY9vX1eWvJBMh25+Wt9IaZm /Zt6LiCq/cklErJMdfWMReW8XHmnNhKAkwYC1Vi+yjti7tYSRJnUwjk59/Qj/q30xRvW2qCv1bc kvqpGSZdecP+l3hIf/NEs X-Received: by 2002:a05:6402:1713:: with SMTP id y19mr11073787edu.286.1620984470700; Fri, 14 May 2021 02:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfJBqZFBKWj/4MZ8aMrds7gZKR5l1ZQNZ/fzLhEZqsf7ePvhUBKvxtTbsw6S08p7GvU/DmLA== X-Received: by 2002:a05:6402:1713:: with SMTP id y19mr11073750edu.286.1620984470525; Fri, 14 May 2021 02:27:50 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6501.dip0.t-ipconnect.de. [91.12.101.1]) by smtp.gmail.com with ESMTPSA id t20sm3351530ejc.61.2021.05.14.02.27.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 May 2021 02:27:50 -0700 (PDT) Subject: Re: [PATCH v19 7/8] arch, mm: wire up memfd_secret system call where relevant To: Mike Rapoport , Andrew Morton References: <20210513184734.29317-1-rppt@kernel.org> <20210513184734.29317-8-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: <227cabb7-17a4-9b39-5893-df825fd2e29b@redhat.com> Date: Fri, 14 May 2021 11:27:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210513184734.29317-8-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Message-ID-Hash: 7CQGWFPX23XKM5JSJG5ZVBFZWB2SEKT3 X-Message-ID-Hash: 7CQGWFPX23XKM5JSJG5ZVBFZWB2SEKT3 X-MailFrom: david@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Hagen Paul Pfeifer , Ingo Molnar , James Bottomley , Kees Cook , "Kirill A. Shutemov" , Matthew Wilcox , Matthew Garrett , Mark Rutland , Michal Hocko , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , "Rafael J. Wysocki" , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , Yury Norov , 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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 13.05.21 20:47, Mike Rapoport wrote: > 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 > Acked-by: Catalin Marinas > Cc: Alexander Viro > Cc: Andy Lutomirski > Cc: Borislav Petkov > Cc: Christopher Lameter > Cc: Dan Williams > Cc: Dave Hansen > Cc: David Hildenbrand > Cc: Elena Reshetova > Cc: Hagen Paul Pfeifer > Cc: "H. Peter Anvin" > Cc: Ingo Molnar > Cc: James Bottomley > Cc: "Kirill A. Shutemov" > Cc: Mark Rutland > Cc: Matthew Wilcox > Cc: Michael Kerrisk > Cc: Palmer Dabbelt > Cc: Paul Walmsley > Cc: Peter Zijlstra > Cc: Rick Edgecombe > Cc: Roman Gushchin > Cc: Shakeel Butt > Cc: Shuah Khan > Cc: Thomas Gleixner > Cc: Tycho Andersen > Cc: Will Deacon > --- > 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 ++++++- > scripts/checksyscalls.sh | 4 ++++ > 7 files changed, 15 insertions(+), 1 deletion(-) > > 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 28a1423ce32e..e44519020a43 100644 > --- a/arch/x86/entry/syscalls/syscall_32.tbl > +++ b/arch/x86/entry/syscalls/syscall_32.tbl > @@ -451,3 +451,4 @@ > 444 i386 landlock_create_ruleset sys_landlock_create_ruleset > 445 i386 landlock_add_rule sys_landlock_add_rule > 446 i386 landlock_restrict_self sys_landlock_restrict_self > +447 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 ecd551b08d05..a06f16106f24 100644 > --- a/arch/x86/entry/syscalls/syscall_64.tbl > +++ b/arch/x86/entry/syscalls/syscall_64.tbl > @@ -368,6 +368,7 @@ > 444 common landlock_create_ruleset sys_landlock_create_ruleset > 445 common landlock_add_rule sys_landlock_add_rule > 446 common landlock_restrict_self sys_landlock_restrict_self > +447 common memfd_secret sys_memfd_secret > > # > # Due to a historical design error, certain syscalls are numbered differently > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index 050511e8f1f8..1a1b5d724497 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -1050,6 +1050,7 @@ asmlinkage long sys_landlock_create_ruleset(const struct landlock_ruleset_attr _ > asmlinkage long sys_landlock_add_rule(int ruleset_fd, enum landlock_rule_type rule_type, > const void __user *rule_attr, __u32 flags); > asmlinkage long sys_landlock_restrict_self(int ruleset_fd, __u32 flags); > +asmlinkage long sys_memfd_secret(unsigned int flags); > > /* > * Architecture-specific system calls > diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h > index 6de5a7fc066b..28b388368cf6 100644 > --- a/include/uapi/asm-generic/unistd.h > +++ b/include/uapi/asm-generic/unistd.h > @@ -873,8 +873,13 @@ __SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule) > #define __NR_landlock_restrict_self 446 > __SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self) > > +#ifdef __ARCH_WANT_MEMFD_SECRET > +#define __NR_memfd_secret 447 > +__SYSCALL(__NR_memfd_secret, sys_memfd_secret) > +#endif > + > #undef __NR_syscalls > -#define __NR_syscalls 447 > +#define __NR_syscalls 448 > > /* > * 32 bit systems traditionally used different > diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh > index a18b47695f55..b7609958ee36 100755 > --- a/scripts/checksyscalls.sh > +++ b/scripts/checksyscalls.sh > @@ -40,6 +40,10 @@ cat << EOF > #define __IGNORE_setrlimit /* setrlimit */ > #endif > > +#ifndef __ARCH_WANT_MEMFD_SECRET > +#define __IGNORE_memfd_secret > +#endif > + > /* Missing flags argument */ > #define __IGNORE_renameat /* renameat2 */ > > Acked-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org