Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp883863pxk; Thu, 24 Sep 2020 23:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygSR0gaDuFbnP1A9gLYlbOneQvtY8C0YrS8POZ4tSeXOUVsaXWTXOtWAbYVcME03e9ljrC X-Received: by 2002:a05:6402:3193:: with SMTP id di19mr2380858edb.211.1601016298851; Thu, 24 Sep 2020 23:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601016298; cv=none; d=google.com; s=arc-20160816; b=KgtN0WD5AaJWhCxaj+co4FbLFs7aanNavBuZQnZs5AB83sx0CvQhGtJN5lZdTEzuDG ZnCN4OAeV9kAPFe5J51soJmaLk7R13pU9fq8lQk5TFU+PBHgsLEPglqJDujUcFNmIHPm lS/HRZ3lkHqIxXdvIrhCA5Un0O8vzWbwlGMC/2eu6fvNeKzR9j6N7oExlUNseVGbWSqO vEVoFAQXG46g8ZpYh/03Yi23QAnAucm3JkW0vgpZjNuCvlkpTqQzOxi6fMOdoyhCNuYZ ESbU3Jea2NJQvdl35fCSYyJAe8ACgZBdJkPfwIYO3pe2VnYX9c2JywZR7rkRRQrxjnR4 eHNg== 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=DN8NGWoiUF1Dmls61KQHVpW0e/bJvXy6QYvLvPlR7Qk=; b=S39qoFq2GqIWvm8xjI5/FmbM9pkycEXDEhpcSzf2yBgjmfFZ9vlr43Be3ReITPGQoC AHmUfm7Fv2+qUJJ/47jUD3GzEbIVtWosOxgsjo5gQzgt5XHmhb5TDIQYsOxV4BlmwpYI u2+pMrSnlRmqYxt/DDqCXZwL07vh1tOtZtSU4Dxk/1rhrP366r/YXyyLbNhmLCD/HIWL zwaYh+4rE5WwPdJOem+FMg4TnlXxr9gtX8Tz70WxTHchLKjgdlX1Zx4Deu5XgvLP8e5W qHHh1hquBYlP55x5AalMgScawWboj0BW0dlA+HF0jqKYcyHw0+w96Y4SIj7zmBqE5yKz M9Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gp4/PTjO"; 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 o4si1214256eje.545.2020.09.24.23.44.34; Thu, 24 Sep 2020 23:44:58 -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="gp4/PTjO"; 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 S1727164AbgIYGnP (ORCPT + 99 others); Fri, 25 Sep 2020 02:43:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:33466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgIYGnP (ORCPT ); Fri, 25 Sep 2020 02:43:15 -0400 Received: from kernel.org (unknown [87.71.73.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 648B621D91; Fri, 25 Sep 2020 06:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601016194; bh=w9IKlZIfJMsHxegJ+VLXCONApnJkHjt/WLrJovIxo84=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gp4/PTjOTCt6wK+y6cBEuicvnrMX77A7MiRNbWPoUrNLDFWXc7dXI8MhLKiFWXqsv W10CVzH2Sh5bikH6aMEPT2GD6WMerz6IjUQAM+CvT/52Z2l6KeVLCZlvbVQ+NG092g JDBOaIbH10dUGBs84yFpT+eEft/TvzNhegpH41cU= Date: Fri, 25 Sep 2020 09:42:57 +0300 From: Mike Rapoport To: Andrew Morton Cc: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Idan Yaniv , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Thomas Gleixner , Shuah Khan , 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 Subject: Re: [PATCH v6 0/6] mm: introduce memfd_secret system call to create "secret" memory areas Message-ID: <20200925064257.GX2142832@kernel.org> References: <20200924132904.1391-1-rppt@kernel.org> <20200924193428.6642e0cc3436bb67ddf8024a@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924193428.6642e0cc3436bb67ddf8024a@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 07:34:28PM -0700, Andrew Morton wrote: > On Thu, 24 Sep 2020 16:28:58 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > Hi, > > > > This is an implementation of "secret" mappings backed by a file descriptor. > > I've dropped the boot time reservation patch for now as it is not strictly > > required for the basic usage and can be easily added later either with or > > without CMA. > > > > ... > > > > The file descriptor backing secret memory mappings is created using a > > dedicated memfd_secret system call The desired protection mode for the > > memory is configured using flags parameter of the system call. The mmap() > > of the file descriptor created with memfd_secret() will create a "secret" > > memory mapping. The pages in that mapping will be marked as not present in > > the direct map and will have desired protection bits set in the user page > > table. For instance, current implementation allows uncached mappings. > > > > Although normally Linux userspace mappings are protected from other users, > > such secret mappings are useful for environments where a hostile tenant is > > trying to trick the kernel into giving them access to other tenants > > mappings. > > > > Additionally, the secret mappings may be used as a mean to protect guest > > memory in a virtual machine host. > > > > For demonstration of secret memory usage we've created a userspace library > > [1] that does two things: the first is act as a preloader for openssl to > > I can find no [1]. Oops, sorry. It's https://git.kernel.org/pub/scm/linux/kernel/git/jejb/secret-memory-preloader.git/ > I'm not a fan of the enumerated footnote thing. Why not inline the url > right here so readers don't need to jump around? > > -- Sincerely yours, Mike.