Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp723145ybx; Fri, 1 Nov 2019 10:11:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUSQe7/aI64kJ3YQASzPVkM7Bh/gP+DPmFTdjhNkyVXyI433bBDR5b/Tb03dh/QcCNg3rn X-Received: by 2002:a17:906:557:: with SMTP id k23mr10546141eja.165.1572628314999; Fri, 01 Nov 2019 10:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572628314; cv=none; d=google.com; s=arc-20160816; b=dR6dXmbS39F8bm1VVC7hQ8TGF+/Fwv3pmWKJBqVrXHlfo7NhtZm7ndI5blR8z4Xws9 o9Yl4LMR4p7VUwEZ+qM+U7V5Kl3Cy8Pw7KJI6V11+TW+m232yi1spqHSpDC354UFiIL4 o8J1BHSKUdvhYEjxx88JqUCRD/nx7H2QCZiwewdxPhdrpldDdyI/M0YD701dIS4w53br 3kr3NkQkIXTadiyb7jAV57de0iNRF5c/F5F8pFBwNmapewtC4lxnDyFQRc8dN65fPTe2 I3hV9o/j4c2x5WXmdhPcLXnLP7VbamA+5nk/Vsxhs/Mk66HlAK8B+pA53OUyHO5n9PJy 0D7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lmpTepUhwlK7jbd0Tewfk/0dx5lGtrUlVCq7CEsqvkU=; b=R33M/rn07MbRM3GngXoNLBki2IHBFPlq7ci7ER8lT9lY2/kgah1IugW0QjVtXhgUOy 5Rnz1YYjTKLA3fRXtjDsyqg5gM+EjCfFmd+Ddv+ztu+Xiu8Krz2SJFne0aIyktJaHYCG /ZzvBqSQaTXSwhoO2aWyS24YFseWGbtl4ydo7P4COh//a+MY/CLxci9vQSRo9uXnU8vM HEIDtlH1GUcY0g1NuuotH/7D00EjH/+4C3pGpshJ3juDcKiN3/uxwUD0VNxuO6PzWgQW 5gWcSAP3uh4JIHQIBQQlQWdowVyjbbg8N3gjYaPztU0f9boxpNzGONlySweiOT9k3XFU tYHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id gu7si5042706ejb.405.2019.11.01.10.11.24; Fri, 01 Nov 2019 10:11:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728709AbfKAPcj (ORCPT + 99 others); Fri, 1 Nov 2019 11:32:39 -0400 Received: from mga07.intel.com ([134.134.136.100]:19571 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727100AbfKAPcj (ORCPT ); Fri, 1 Nov 2019 11:32:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2019 08:32:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,256,1569308400"; d="scan'208";a="375595027" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by orsmga005.jf.intel.com with ESMTP; 01 Nov 2019 08:32:38 -0700 Date: Fri, 1 Nov 2019 08:32:38 -0700 From: Sean Christopherson To: Stephen Smalley Cc: Jarkko Sakkinen , linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com, linux-security-module@vger.kernel.org, Suresh Siddha Subject: Re: [PATCH v23 12/24] x86/sgx: Linux Enclave Driver Message-ID: <20191101153238.GA2657@linux.intel.com> References: <20191028210324.12475-1-jarkko.sakkinen@linux.intel.com> <20191028210324.12475-13-jarkko.sakkinen@linux.intel.com> <173a196e-fa6b-23b8-c818-dfca6cdadcc6@tycho.nsa.gov> <20191031211721.GD10507@linux.intel.com> <4bf866ae-adc8-7902-3714-b62e548d8584@tycho.nsa.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4bf866ae-adc8-7902-3714-b62e548d8584@tycho.nsa.gov> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 01, 2019 at 09:28:17AM -0400, Stephen Smalley wrote: > On 11/1/19 9:16 AM, Stephen Smalley wrote: > >So, IIUC, that means that merging the driver will create a regression with > >respect to LSM control over executable mappings that will only be > >rectified at some future point in time if/when someone submits LSM hooks > >or calls to existing hooks to restore such control.? That doesn't seem > >like a good idea.? Why can't you include at least that basic level of > >control now?? It is one thing to defer finer grained control or > >SGX-specific access controls to the future - that I can understand.? But > >introducing a regression in the existing controls is not really ok. > > Unless you are arguing that the existing checks on mmap/mprotect of > /dev/sgx/enclave are a coarse-grained approximation (effectively requiring > WX to the file or execmem for any user of SGX). Yes, that's the argument as running any enclave will require RWX access to /dev/sgx/enclave. EXECMEM won't trigger for SGX users as /dev/sgx/enclave must be MAP_SHARED and it's a non-private file (not backed by anonymous inode, in case I got the file terminology wrong).