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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH, URIBL_BLOCKED autolearn=unavailable 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 5C675C072B5 for ; Fri, 24 May 2019 19:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 324F2217F9 for ; Fri, 24 May 2019 19:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558726259; bh=++eJML+V7at8ynu0Gghi2KtbxEtQiKNCqvYyHJW4D1g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=QVTrq7WfP/BV5wgQ1aLLID4PuyMfTkp6QRoOJEXRMwG1N6syAk0CwVuxqoz5/KC9s +UDi8cwY5583k8lRQv1vwEvsBbHEG7KkwtJjqRWtdp+g3lK4zhTjxTMpyi8NsJXM/n a1ShKe0FpVQZ01Qwnxjn/PYFfU13+Dvbrnh2jng4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732102AbfEXTa6 (ORCPT ); Fri, 24 May 2019 15:30:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:47512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbfEXTa6 (ORCPT ); Fri, 24 May 2019 15:30:58 -0400 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9C7FC21880 for ; Fri, 24 May 2019 19:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558726257; bh=++eJML+V7at8ynu0Gghi2KtbxEtQiKNCqvYyHJW4D1g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gpba4nvhqX6NHqtFJ0DX/6Shq7xMP0QKoNvfrDVV3xkDOBWCDw5N6YSWROb4D5Zsd YGWK6QSvX2KpgKTRZlio6xCZ0RViGeRa53/YyUp+E/Tfon1Xxt61VpzWYYHwEKOXug 46je9P+s2sQxCc9G30mS5qMHz5KhkDO05Ar9qt2c= Received: by mail-wm1-f43.google.com with SMTP id x64so10442693wmb.5 for ; Fri, 24 May 2019 12:30:57 -0700 (PDT) X-Gm-Message-State: APjAAAXQcvbNs0+W0kSR18nQOCB4SBqkLNvvaxgdXiAt0HKQXLGyxpoU /kIZje4dXFBRZV9mP3EUtjj8dekM6eN25lDbnocA3A== X-Google-Smtp-Source: APXvYqyLb4T/bZMdmeEdv3r/4ynyWFeM04ByJvHBR7hqFkVePfmxiSgk3D8BRYB56wOHtSETPWa/diJlf770zautMsU= X-Received: by 2002:a1c:1d4:: with SMTP id 203mr1051004wmb.76.1558726256158; Fri, 24 May 2019 12:30:56 -0700 (PDT) MIME-Version: 1.0 References: <20190523102628.GC10955@linux.intel.com> <20190523141752.GA12078@linux.intel.com> <20190523234044.GC12078@linux.intel.com> <960B34DE67B9E140824F1DCDEC400C0F654E8956@ORSMSX116.amr.corp.intel.com> <20190524174243.GA365@linux.intel.com> <20190524175458.GB365@linux.intel.com> <960B34DE67B9E140824F1DCDEC400C0F654E8E1D@ORSMSX116.amr.corp.intel.com> <20190524191344.GD365@linux.intel.com> In-Reply-To: <20190524191344.GD365@linux.intel.com> From: Andy Lutomirski Date: Fri, 24 May 2019 12:30:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support) To: Sean Christopherson Cc: "Xing, Cedric" , Stephen Smalley , Andy Lutomirski , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , LSM List , Paul Moore , Eric Paris , "selinux@vger.kernel.org" , Jethro Beekman , "Hansen, Dave" , Thomas Gleixner , "Dr. Greg" , Linus Torvalds , LKML , X86 ML , "linux-sgx@vger.kernel.org" , Andrew Morton , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "Katz-zamir, Shay" , "Huang, Haitao" , Andy Shevchenko , "Svahn, Kai" , Borislav Petkov , Josh Triplett , "Huang, Kai" , David Rientjes Content-Type: text/plain; charset="UTF-8" Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org On Fri, May 24, 2019 at 12:13 PM Sean Christopherson wrote: > > On Fri, May 24, 2019 at 11:34:32AM -0700, Xing, Cedric wrote: > > > From: linux-sgx-owner@vger.kernel.org [mailto:linux-sgx- > > > owner@vger.kernel.org] On Behalf Of Sean Christopherson > > > Sent: Friday, May 24, 2019 10:55 AM > I don't see a fundamental difference between having RWX in an enclave and > RWX in normal memory, either way the process can execute arbitrary code, > i.e. PROCESS__EXECMEM is appropriate. Yes, an enclave will #UD on certain > instructions, but that's easily sidestepped by having a trampoline in the > host (marked RX) and piping arbitrary code into the enclave. Or using > EEXIT to do a bit of ROP. There's a difference, albeit a somewhat weak one, if sigstructs are whitelisted. FILE__EXECMOD on either /dev/sgx/enclave or on the sigstruct is not an entirely crazy way to express this.