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.8 required=3.0 tests=BAYES_00, 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 00284C433E1 for ; Wed, 26 Aug 2020 19:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEFED2078A for ; Wed, 26 Aug 2020 19:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbgHZTBi (ORCPT ); Wed, 26 Aug 2020 15:01:38 -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.