Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp741578ybz; Wed, 29 Apr 2020 08:34:23 -0700 (PDT) X-Google-Smtp-Source: APiQypIkjpVPrKEa7jxHC/Q2nGDzb9YR53xVBIsCWBpvKo6KVNzn+BoIoUbhwsTwwWars7ld1gYr X-Received: by 2002:aa7:dacc:: with SMTP id x12mr3019955eds.363.1588174463812; Wed, 29 Apr 2020 08:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588174463; cv=none; d=google.com; s=arc-20160816; b=Szxmc9bTR28LD8GztDYsipdlOyC59NIKAdalLm/vNMqe4evbphgMRbxxyN+c5bhbTH m7lGpbd9pGZCD2aZKpX4WRYZUzTzf/g1FIveH2TvK/j0UyXkTclGHr7LQE54Ijr0HNQ7 QlOZgUSlPcHEyDa2C+8TDjOIam8ydZGTGpswmvPv/51m2BtzFln759c0vJn6wqa8PPUb JTdpBJV38Z+8U1/lDl0cxTJ6mfL5IhK+yo63GreYoJkxLJAhJtv0zIB7l8qKtA54GoLu LnmP9i2Y6NKkC7BraAcSNP5KbJX8OY+f/MJr7tUPhygHyzpp/iyi3sNxvT0FWDIKB0As e0bw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=42wqH+2+q3O+9Bd6//z7jLY8xt0lV17bX0jXbRXmfV8=; b=Zov/DSSC+/fX8e6+PwanqdgvfMIa0kb+nmXGL7qxLRBQf1wNNBwoHvwZfi6WBVSicf yRD31LOE2U68nstEaeYR+ZISoeY3KF8qGp610GXiY8SlIZ8uuIPTE4CytM7hfTaWjWYE xFxRfUPyqGbyYcLkn9mk4FbBNraZKn32gooC8jRH/V3boZRGAiktQnxYFR7mEhhRfEPD Qc6+o1oKKKiX+jF2nq6Cq8dZ0ZcfMD7F6qdWrR1ZeHYL2x3OSFwfZ2SgOm1LfM+uMYlD E5yuaYGpb1gma3w2igIB/3qYarn7KczSSHvCXj+Fzs3XfascWT8uw1mLMn1YiaBZT6cf ES2g== 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 o61si3378737edb.125.2020.04.29.08.33.56; Wed, 29 Apr 2020 08:34:23 -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 S1726773AbgD2PaG (ORCPT + 99 others); Wed, 29 Apr 2020 11:30:06 -0400 Received: from mga04.intel.com ([192.55.52.120]:53437 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgD2PaF (ORCPT ); Wed, 29 Apr 2020 11:30:05 -0400 IronPort-SDR: glru2NjHAqeLb9eMFKK5uSxfskdQU5n//BnA/v5vG/YxRC58ax38nqC75wLbpux/g120Jq5xd+ gIre5RnCqTCw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 08:30:05 -0700 IronPort-SDR: IsOo2m5hKDJWvB8cLxXv2tSJTgbWHqTSHwVmntgbu4ZJeYgSkqhJZFzNg96HRz/pCPc/2/jOMh iee/vjZ65KWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,332,1583222400"; d="scan'208";a="257994210" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga003.jf.intel.com with ESMTP; 29 Apr 2020 08:30:05 -0700 Date: Wed, 29 Apr 2020 08:30:04 -0700 From: Sean Christopherson To: "Dr. Greg" Cc: Jarkko Sakkinen , torvalds@linux-foundation.org, 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, 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 Subject: Re: [PATCH v29 00/20] Intel SGX foundations Message-ID: <20200429153004.GD15992@linux.intel.com> References: <20200421215316.56503-1-jarkko.sakkinen@linux.intel.com> <20200426165753.GA11046@wind.enjellic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200426165753.GA11046@wind.enjellic.com> 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 Sun, Apr 26, 2020 at 11:57:53AM -0500, Dr. Greg wrote: > In closing, it is important to note that the proposed SGX driver is > not available as a module. This effectively excludes any alternative > implementations of the driver without replacement of the kernel at > large. No it doesn't. The SGX subsytem won't allocate EPC pages unless userspace creates an enclave, i.e. preventing unprivileged userspace from accessing /dev/sgx/enclave will allow loading an alternative out-of-tree SGX module. Yes, SGX sanitizes the EPC on boot, but that's arguably a good thing for out-of-tree modules. And if you want to get crafty and squash in-kernel SGX altogether, boot with "clearcpuid=" and/or "clearcpuid=" to disable in-kernel support entirely. SGX won't be correctly enumerated in /proc/cpuinfo relative to the existence of an out-of-tree module, but that seems like a very minor issue if you're running with a completely different SGX driver. > It also means that any platform, with SGX hardware support, > running a kernel with this driver, has the potential for the > security/privacy issues noted above. Unless I'm mistaken, /dev/sgx is root-only by default. There are far scarier mechanisms available to root for hosing the system. > If key based policy management is not allowed, then the driver needs > to be re-architected to have modular support so that alternative > implementations or the absence of any driver support are at least > tenable. As above, using an alternative implementation is teneble, albeit a bit kludgy.