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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 45931C433E0 for ; Mon, 15 Feb 2021 09:13:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC69764E05 for ; Mon, 15 Feb 2021 09:13:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC69764E05 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1C8D88D00E3; Mon, 15 Feb 2021 04:13:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 17A348D0060; Mon, 15 Feb 2021 04:13:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 091438D00E3; Mon, 15 Feb 2021 04:13:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id E698E8D0060 for ; Mon, 15 Feb 2021 04:13:53 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9CD13BEFE for ; Mon, 15 Feb 2021 09:13:53 +0000 (UTC) X-FDA: 77819939946.03.13D25D5 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf27.hostedemail.com (Postfix) with ESMTP id 935E380192C7 for ; Mon, 15 Feb 2021 09:13:50 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613380431; h=from:from:reply-to: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=miCNDkPWZZBRVJ8Jtr1LFzD24yWA9N0KNTV3BkO+MBs=; b=TETHPiEq8kl7uQEKm1Aff4L3NsQE0DM02/lfPkpKudaCI6/5lNvCven/uHuRT24qzIXWlb R5BxAqdLhSywOBM2nG5lWN1rFZRScNEvDlYO6zf3OlgEc7VuRTl3HqG4uIymDgc/8zHABu C6iAKZCoFVJI6hxssRHEbP17I8dvFo0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9278BAD19; Mon, 15 Feb 2021 09:13:51 +0000 (UTC) Date: Mon, 15 Feb 2021 10:13:50 +0100 From: Michal Hocko To: James Bottomley Cc: David Hildenbrand , Mike Rapoport , Mike Rapoport , Andrew Morton , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , 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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Hagen Paul Pfeifer , Palmer Dabbelt Subject: Re: [PATCH v17 07/10] mm: introduce memfd_secret system call to create "secret" memory areas Message-ID: References: <20210214091954.GM242749@kernel.org> <052DACE9-986B-424C-AF8E-D6A4277DE635@redhat.com> <244f86cba227fa49ca30cd595c4e5538fe2f7c2b.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <244f86cba227fa49ca30cd595c4e5538fe2f7c2b.camel@linux.ibm.com> X-Stat-Signature: rjawmek5unhkm95bc6akif63g8j58g9c X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 935E380192C7 Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613380430-798849 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun 14-02-21 11:21:02, James Bottomley wrote: > On Sun, 2021-02-14 at 10:58 +0100, David Hildenbrand wrote: > [...] > > > And here we come to the question "what are the differences that > > > justify a new system call?" and the answer to this is very > > > subjective. And as such we can continue bikeshedding forever. > >=20 > > I think this fits into the existing memfd_create() syscall just fine, > > and I heard no compelling argument why it shouldn=E2=80=98t. That=E2=80= =98s all I can > > say. >=20 > OK, so let's review history. In the first two incarnations of the > patch, it was an extension of memfd_create(). The specific objection > by Kirill Shutemov was that it doesn't share any code in common with > memfd and so should be a separate system call: >=20 > https://lore.kernel.org/linux-api/20200713105812.dnwtdhsuyj3xbh4f@box/ Thanks for the pointer. But this argument hasn't been challenged at all. It hasn't been brought up that the overlap would be considerable higher by the hugetlb/sealing support. And so far nobody has claimed those combinations as unviable. > The other objection raised offlist is that if we do use memfd_create, > then we have to add all the secret memory flags as an additional ioctl, > whereas they can be specified on open if we do a separate system call.=20 > The container people violently objected to the ioctl because it can't > be properly analysed by seccomp and much preferred the syscall version. >=20 > Since we're dumping the uncached variant, the ioctl problem disappears > but so does the possibility of ever adding it back if we take on the > container peoples' objection. This argues for a separate syscall > because we can add additional features and extend the API with flags > without causing anti-ioctl riots. I am sorry but I do not understand this argument. What kind of flags are we talking about and why would that be a problem with memfd_create interface? Could you be more specific please? --=20 Michal Hocko SUSE Labs