Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2678032pxk; Sun, 27 Sep 2020 17:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym9k50qc7w+/2dvLo4Gc6AJnui8Jv2tnyI/RxeXAPmti8+Qf6ZJSwzDOWaGOqhsBZtp5tS X-Received: by 2002:a50:ed94:: with SMTP id h20mr13257355edr.184.1601254711987; Sun, 27 Sep 2020 17:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601254711; cv=none; d=google.com; s=arc-20160816; b=xITea6KJcokK9pQ+ScE9BoUIE7M2QX7lm++6AZtAWLZGY42rifzjiCtHvBxOmcLTlJ E/zPyAypOzKbX5JHL+lcyxP1pUQcAL/Zxy3Tf1lSDhMWwHm6u9y+MU8y++7lEq53CnYU V4+p9OcgSF94lip2gXyFOJ5liOtoZNzA9+mvbU+03jkbVg6RbKxAn3hdqjcPYq47bj7f +xUDmh6F2Mmc6MPOD+Q2Lp8qOa0CO+ablAQWIZTC9FqWsw3Z9PPN1dHpVhfpM3hcaeX5 OJtbS9xx8kxWTjYAGkjU44+9UJ/Z6CSAG1BTGxk7Sp98EeK7JvvpVOhyAec/N7t8jzlv rzWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=DiVEhbHY1zZeZaq9aP+IGEqfQS62+dMWyKe+js3+mFQ=; b=im2L2Xm7Gilu9xEUXhW+NLsW/K2f3mHmscg/9Wdy4iM9gwwKuwIQnydLhBReMUcU2A zZ+z+V8t+2WWtwvDVQzDlcDnAT3Ta2vuHL7PPLiAxDI7WpKdePIZdvriV93o5n8TWFDV q77B+iFEcvgGTvSpnlyJ2L3pQsC4BQeKE3jKOw1WIxZKsrYofFZbbUALbG7mgmrDMnWD Nvwp0L5g6ENe+W+DliSAhBBiXBuMUX+XBhyM6hgsZjiYx5jJZJB0UgZMZ64hacfJDOFH dDxHOuG46HJQLvR4vy6fXlK5LooyQzDi5rnFM03ZQLWYUv3xi1P3EU1DbRAK1pA/v+PG MAAw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si6794319edw.139.2020.09.27.17.58.09; Sun, 27 Sep 2020 17:58:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgI1Axx (ORCPT + 99 others); Sun, 27 Sep 2020 20:53:53 -0400 Received: from mga06.intel.com ([134.134.136.31]:52586 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbgI1Axx (ORCPT ); Sun, 27 Sep 2020 20:53:53 -0400 IronPort-SDR: F3lTCFor3BehzZy68OTkrmPctt/VjcUb9UHcmo0AJU5NHqgrsmkBM60TVSI5OHXYVzH1DCp3tn Viv+ygcg54tw== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="223515588" X-IronPort-AV: E=Sophos;i="5.77,312,1596524400"; d="scan'208";a="223515588" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 17:53:52 -0700 IronPort-SDR: lxwidzLM4mRdV7zMs4wsmOkdU6oHCAdz+ZoVXa3zOb1YxW5go5cLMvTEwXPXE8YHyMdJYjfpXV 3uRowWkLMbdA== X-IronPort-AV: E=Sophos;i="5.77,312,1596524400"; d="scan'208";a="488352400" Received: from memara-mobl.ger.corp.intel.com (HELO localhost) ([10.252.49.157]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 17:53:45 -0700 Date: Mon, 28 Sep 2020 03:53:47 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Sean Christopherson , Haitao Huang , Andy Lutomirski , X86 ML , linux-sgx@vger.kernel.org, LKML , Linux-MM , Andrew Morton , Matthew Wilcox , Jethro Beekman , Darren Kenny , Andy Shevchenko , asapek@google.com, Borislav Petkov , "Xing, Cedric" , chenalexchen@google.com, Conrad Parker , cyhanish@google.com, "Huang, Haitao" , Josh Triplett , "Huang, Kai" , "Svahn, Kai" , Keith Moyer , Christian Ludloff , Neil Horman , Nathaniel McCallum , Patrick Uiterwijk , David Rientjes , Thomas Gleixner , yaozhangx@google.com Subject: Re: [PATCH v38 10/24] mm: Add vm_ops->mprotect() Message-ID: <20200928005347.GB6704@linux.intel.com> References: <20200924200156.GA19127@linux.intel.com> <20200924202549.GB19127@linux.intel.com> <20200924230501.GA20095@linux.intel.com> <20200925000052.GA20333@linux.intel.com> <32fc9df4-d4aa-6768-aa06-0035427b7535@intel.com> <20200925194304.GE31528@linux.intel.com> <230ce6da-7820-976f-f036-a261841d626f@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <230ce6da-7820-976f-f036-a261841d626f@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 12:53:35PM -0700, Dave Hansen wrote: > On 9/25/20 12:43 PM, Sean Christopherson wrote: > >> That means that the intent argument (SGX_PROT_*) is currently unused. > > No, the intent argument is used (eventually) by SGX's ->mprotect() > > implementation, i.e. sgx_mprotect() enforces that the actual protections are a > > subset of the declared/intended protections. > > > > If ->mprotect() is not merged, then it yes, it will be unused. > > OK, I think I've got it. > > I think I'm OK with adding ->mprotect(). As long as folks buy into the > argument that intent needs to be checked at mmap() time, they obviously > need to be checked at mprotect() too. > > Jarkko, if you want to try and rewrite the changelog, capturing the > discussion here and reply, I think I can ack the resulting patch. I > don't know if that will satisfy the request from Boris from an ack from > a "mm person", but we can at least start there. :) I think what it needs, based on what I've read, is the step by step description of the EMODPE scenarion without this callback and with it. I think other important thing to underline is that an LSM or any other security measure can only do a sane decision when the enclave is loaded. At that point we know the source (vm_file). I.e. when you are doing mmap() or mprotect() you don't have that information. The permissions kind of describe the contact made at that point of time. > Please be judicious in what you include in the changelog. There's been > a lot of detritus in them. Let's keep it as short, sweet, simple and on > topic as we can. Of course. /Jarkko