Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp339416pxa; Wed, 26 Aug 2020 12:04:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3psfuuSkRJSg2u/gPu7wjFcynPEMY5VjyrbyfG8nscYCUn2KU+tWV2vlrtGdgHLWzD9fy X-Received: by 2002:a17:906:eb4f:: with SMTP id mc15mr16756383ejb.435.1598468652178; Wed, 26 Aug 2020 12:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598468652; cv=none; d=google.com; s=arc-20160816; b=LGBXJI3pFN+K/MvkM/dp2OH3cOGmwASofkMfwLwJIqDxUh+HEzPjrOjkWXzdENRAVk I4ezIrUgNwYihCSs29mt1og9M2k7/9nMfDC/j35MRxWTUrs9m1FU0gul/HNJlwKv3xJx oCNnp9giXT02nztK5DVG2fidNXQWzoQ/wFSOUtYyApByQf4lV9ZoHcBs7qGHCO7sNpBY E7Crbn3DC7tgCNGkzd0aczJ4pzPBdCxy0yR+/cbCSKxQn43EzBrdPqQ+OGT5SJsCYKxA cNG/TwZpzsy6km+8mMizYbLsBS04+rCR2M6Vq+y52pAmxHDrSVcdqEvB27tRgqaH3BEh X4xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=B6H806oqMSC5lfv40fNgrDphfUonv/5+n99Or5/NN2k=; b=aKRxWldH1DQJd008ZqhrGEU7SyX0uAnVfH26aBgj1mxPogQr+xy9KNf01EM4Rr//fp uRI1BzePNEymPspmaNMn8oPImtTgn13QvkO3MkTQdKEIYN66DXpgw4msU3SXUdQKrYZY v5NcCysQdyO5Rov0yDSGjSXS7d6JXI4rky2Jr9wszcvBk77+zbxWV8fZ61sr49zpanJ+ q0DY2KD3xORb+nPIWb1s6v5kvVuL727oB889Zi5jWx5A6Sb1hxOfMBbVWFcP9P0fLhIu E2rSqV2u1iulMkXJho/e7dPi60uzmeeDJGfZ6YaKteMV/D4HKSf7XFUQd7Zd0Vr+iTh5 TXBg== ARC-Authentication-Results: i=1; mx.google.com; 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 y22si2205921ejc.453.2020.08.26.12.03.48; Wed, 26 Aug 2020 12:04:12 -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; 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 S1726767AbgHZTBh (ORCPT + 99 others); Wed, 26 Aug 2020 15:01:37 -0400 Received: from albireo.enyo.de ([37.24.231.21]:37884 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbgHZTBc (ORCPT ); Wed, 26 Aug 2020 15:01:32 -0400 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kB0fd-00039M-Py; Wed, 26 Aug 2020 19:01:17 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kB0fd-0004bF-Mv; Wed, 26 Aug 2020 21:01:17 +0200 From: Florian Weimer To: Andy Lutomirski Cc: Dave Hansen , Mike Rapoport , LKML , Alan Cox , Andrew Morton , Christopher Lameter , Dave Hansen , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Peter Zijlstra , "Reshetova\, Elena" , Thomas Gleixner , Tycho Andersen , Linux API , Linux-MM Subject: Re: [RFC PATCH] mm: extend memfd with ability to create "secret" memory areas References: <20200130162340.GA14232@rapoport-lnx> <6e020a65-b516-9407-228f-2a3a32947ab9@intel.com> Date: Wed, 26 Aug 2020 21:01:17 +0200 In-Reply-To: (Andy Lutomirski's message of "Wed, 26 Aug 2020 09:54:57 -0700") Message-ID: <87y2m1qlj6.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski: >> I _believe_ there are also things like AES-NI that can get strong >> protection from stuff like this. They load encryption keys into (AVX) >> registers and then can do encrypt/decrypt operations without the keys >> leaving the registers. If the key was loaded from a secret memory area >> right into the registers, I think the protection from cache attacks >> would be pretty strong. > > Except for context switches :) An rseq sequence could request that the AVX registers should be cleared on context switch. (I'm mostly kidding.) I think the main issue is that we do not have a good established programming model to actually use such features and completely avoid making copies of secret data.