Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp722061pxy; Wed, 5 May 2021 12:09:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI+AkFmIkL2vA1WPXABreQ4nomB7vZ55SiLUATmpC+Fhckc/R5VpXVM4DrPGA8LHwkiCNv X-Received: by 2002:a17:902:d2d2:b029:ee:fb71:c05e with SMTP id n18-20020a170902d2d2b02900eefb71c05emr585160plc.13.1620241775794; Wed, 05 May 2021 12:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620241775; cv=none; d=google.com; s=arc-20160816; b=eRHrjSYeuEoivKe/g5Yhjnftkt0Ens5bMjC7u0p0V4e52h5E6FISpAek4SSk4QqT1r gQl4UFdAnpS1ZXTbbaDRcSnD5/HWCJwu+AE9zXA0Wmycz/MKahkMcZXcOMV9EgILY9JL wXR/p8/36XouNg2LJPpZ8ahZPYgUjopHjV4gr/54iuKPjV4GpLaRaw303wjP9u/1vhEp QSItnlbw8+OwKW/rM/KhCgFiO2zbQapjhTlY4C1S+MFehBnSFKA0XJ/wqSt9/TmrDduv VHcjPwxapcj+fG+orwbIsHZ2Ikqkxnnx4tFfEq0MkVTWBmPcBlMqfN+kynL0WWD4qqC4 XN2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KetdvTVcEZYEg3KI8wZrAYaLGmySEOM12uTYfAQ4Bd4=; b=ybfO8eYBOj4QsZRCEAKONWvlqWGWu+6+L9W/RdzkqQCfVAum+tAafg7HctiTfySYHP cyKkn0nM9d+FW9VWq/QzlQCN3LmFjJCz2y6TTgV6C3jLoESovHqxaYnlbwFF8I7zjLhs MFS8rpU06nZMsc4CajCMii6A827X3gk4HSXBNW2Y89C7IIIJtWs0jVSoZwZMavcMpQOx mhGwisj5gjcOGXldE/gaVQ9kvB48JNg01HIptPGyMO+1ZATL7PODysZ0LQ5Eh3GfTiu7 AY+yl3eYnDlo3Ca4u47pBKSmjAPbDYiWKNcaralwzZTaGNKiH+GEEtQujDlPwH2elrGi RHbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="ug/m3Htu"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si8797785plr.193.2021.05.05.12.09.22; Wed, 05 May 2021 12:09:35 -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=@linux-foundation.org header.s=korg header.b="ug/m3Htu"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235264AbhEETJI (ORCPT + 99 others); Wed, 5 May 2021 15:09:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234949AbhEETJH (ORCPT ); Wed, 5 May 2021 15:09:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F53D613BC; Wed, 5 May 2021 19:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620241689; bh=hhpxxXD6aDeVp5ZewAeV19qTR1ebHSAlNlE2Ux5iOSM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ug/m3Htuj/0ky54AF8kZ3lyLJYozDhbNWgyIX0TCxQniyIIVskzJR85jb1a8l24+P wj3Uq3KGTcmSyyj8MjENJW/Q1S0V1k1C7Ipr+8QQ7aULrVrbnYhAQH9rFXWSlKHVc9 sXdVqWFVybXYIICA46jG/2KrFmKvLuINZAazEgtE= Date: Wed, 5 May 2021 12:08:06 -0700 From: Andrew Morton To: Mike Rapoport Cc: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Matthew Garrett , Mark Rutland , Michal Hocko , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , "Rafael J. Wysocki" , 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 Subject: Re: [PATCH v18 0/9] mm: introduce memfd_secret system call to create "secret" memory areas Message-Id: <20210505120806.abfd4ee657ccabf2f221a0eb@linux-foundation.org> In-Reply-To: <20210303162209.8609-1-rppt@kernel.org> References: <20210303162209.8609-1-rppt@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Mar 2021 18:22:00 +0200 Mike Rapoport wrote: > This is an implementation of "secret" mappings backed by a file descriptor. > > 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 be present only in the page table of the owning mm. > > 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. I continue to struggle with this and I don't recall seeing much enthusiasm from others. Perhaps we're all missing the value point and some additional selling is needed. Am I correct in understanding that the overall direction here is to protect keys (and perhaps other things) from kernel bugs? That if the kernel was bug-free then there would be no need for this feature? If so, that's a bit sad. But realistic I guess. Is this intended to protect keys/etc after the attacker has gained the ability to run arbitrary kernel-mode code? If so, that seems optimistic, doesn't it? I think that a very complete description of the threats which this feature addresses would be helpful.