Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5843507pxb; Tue, 16 Feb 2021 08:54:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVkG3SGCPMw8YZYuemxoEEp5ETF9AdsTh0yhOE3Q4AJIBIA6osQ8g5KyiVKW2hVRRF8PUH X-Received: by 2002:a17:906:28d6:: with SMTP id p22mr21483234ejd.365.1613494454014; Tue, 16 Feb 2021 08:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613494454; cv=none; d=google.com; s=arc-20160816; b=yGoyKJizFEd6kwgVpgijVdn8UftAODO2VW8+atjjrFEsDNasuYRTTagXPZ+KJ/E3uy OmFs87LVhgQEiD6tcBNAIsCgKE8WYUvOBMmC9S26QrMZB39gLpq3C5Goo80Si9kj2yRl RQrLg79MR1qZ5KfsdSN7AXq3lcbe3UPVk9HRAE9VfrEFJMc4VYyguu+7kp6Q/IaW1rRS QZKueF1naI4eLtxVyGv8UkaADwis8AfXyctz+wNZswoGt2IQHeT5lFePo2BCpVOXXEu3 7F8omYbInsnjqpggGij/EIjgzxtvWBBZw4ArdqlACDqF71ZHbFmT4D68tc+Nrc5M2WBs TA1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fv1cqvwsI0OzZQzjo9Fzqiw9J9sAKYM15trtTiADU8I=; b=FBAiHW+Zc65LJGiWK33EfuOqN+B1w2iECa9vH2hYPRkWDAU5uSIN9EE9XpD4qjphCR E80ED4D1uCZB7IA0N/OG0MUE5u6V/s9+xip6AjIssLGqBkxE1geDJono3kjllc2y5sxe ttk3oLc8Pjyuj9uMnNnUXh97/lPJPa69KfGzqA4RWWVBPh0Au/XMgsEwihLi81IGdzVw lhDuPeZ3uf5JSyCk3rO/3TmfKvfcYIJAFtsoV/7Jj3GW3FX77EDlv9nAu5Hjsg2Jl2mh WqqpHghudOb0YP1TUv61SwHzzde84i8U5GBA2Uu7yN0Yf0Vf3UE16g8uVY7zwyFFADH7 JKTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=m+7A3yBn; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq26si15123693edb.317.2021.02.16.08.53.50; Tue, 16 Feb 2021 08:54:13 -0800 (PST) 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=@suse.com header.s=susede1 header.b=m+7A3yBn; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbhBPQw1 (ORCPT + 99 others); Tue, 16 Feb 2021 11:52:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:56872 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbhBPQwX (ORCPT ); Tue, 16 Feb 2021 11:52:23 -0500 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=1613494295; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fv1cqvwsI0OzZQzjo9Fzqiw9J9sAKYM15trtTiADU8I=; b=m+7A3yBnlzXwcSFUtKDR2Y9JcLQQ7GBKZLbjSDY4uRJe8Oprcc1t3A0Yb4nCpmSjJzTq71 m2lvwh4POgKc94rijkZTo8EsctDQ8udo5YFmIVVBqcDZmQE+zdGsrWJMYIvr1Q40Hpav5m AI5AIoiWGkF74EgEjx/NO759Sl7hNIs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 93467AE05; Tue, 16 Feb 2021 16:51:35 +0000 (UTC) Date: Tue, 16 Feb 2021 17:51:34 +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> <12c3890b233c8ec8e3967352001a7b72a8e0bfd0.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12c3890b233c8ec8e3967352001a7b72a8e0bfd0.camel@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 16-02-21 08:25:39, James Bottomley wrote: > On Mon, 2021-02-15 at 20:20 +0100, Michal Hocko wrote: > [...] > > > > 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? > > > > > > You mean what were the ioctl flags in the patch series linked > > > above? They were SECRETMEM_EXCLUSIVE and SECRETMEM_UNCACHED in > > > patch 3/5. > > > > OK I see. How many potential modes are we talking about? A few or > > potentially many? > > Well I initially thought there were two (uncached or not) until you > came up with the migratable or non-migratable, which affects the > security properties. But now there's also potential for hardware > backing, like mktme, described by flags as well. I do not remember details about mktme but from what I still recall it had keys associated with direct maps. Is the key management something that fits into flags management? > I suppose you could > also use RDT to restrict which cache the data goes into: say L1 but not > L2 on to lessen the impact of fully uncached (although the big thrust > of uncached was to blunt hyperthread side channels). So there is > potential for quite a large expansion even though I'd be willing to bet > that a lot of the modes people have thought about turn out not to be > very effective in the field. Are those very HW specific features really viable through a generic syscall? Don't get me wrong but I find it much more likely somebody will want a hugetlb (pretty HW independent) without a direct map than a very close to the HW caching mode soon. But thanks for the clarification anyway. -- Michal Hocko SUSE Labs