Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1138910yba; Thu, 16 May 2019 15:12:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDx/nfA7HmqK7JkbHLCdVpGe1/UR5e8R02tMwO+HeM3DYIAVXlBbYWARD0ifkOY1wZe7Q1 X-Received: by 2002:a17:902:5589:: with SMTP id g9mr21140073pli.187.1558044752006; Thu, 16 May 2019 15:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558044751; cv=none; d=google.com; s=arc-20160816; b=pOLlDsbKUQarb5IAAcfy1LgAC00/6hLH/CPXGOnFOZMcIfDtX/cg1okfP5ZUgzdyW8 9C83cTtbVxU7x7NQa97EtUTrXgW7difClyRu16KW73T0ggbep2lolPvKZ+vAA9gE6dmH Hk4lWDiW3chP/0HE9cpmwCBAYsUpfwwYJ+mfVqHB80FrJZo24RXyU7a8U+44N81O3jZl RDjkKG6SI9MVYF73KXhK5cm9lCPUBWGQtmH88G5xuaShjDChYB7M2TjK4R9HROzifNb7 mfXSkU8wMQOo2eaY8mRrlPU7XSr3oCf50jcQwmMRxjR7Yuq7TUDhaqIZG/pEmk4dBmit 0HjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tFRbeulEaawWbE/yJcp6Z+iuGE9r5mOKg82ANQ4qZek=; b=H9DLvsyYssNlcRyk23fjoy0TJtPWeW4RjYqGSSGcKpB+RYkSHoCROXBjsRi3pG8c65 4IsJ2v80VRb02y5S/thIrgUdG9CGaxiQ4GrYBj1AOOr4Bxlbuqrm25v2rPjkTaBnczoX 1eXa/sXNdGKfZj0j99qY/oQTlPDKDoL4ywPnV+VzECsBeuCz6jDlzwuatbJBm12rnWTo UZdzV57nFQQzkzpTSbOgfZLc0IZgb5WWzji7g4SAjDqCFIusDU99nHhSNLhKiy6e3Ynt 9S18IwpKUFbKwGZlkZ+hrp6LNGXpJ3vzels4LifOe96wbrLBbWr/bf0M/bQ6u0JwmOz0 h3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a7BgMrGt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si5787889plx.432.2019.05.16.15.12.00; Thu, 16 May 2019 15:12:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=a7BgMrGt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbfEPVA3 (ORCPT + 99 others); Thu, 16 May 2019 17:00:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728187AbfEPVA2 (ORCPT ); Thu, 16 May 2019 17:00:28 -0400 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 2744C21773 for ; Thu, 16 May 2019 21:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558040427; bh=Z9A5Gn8IYTN5zojnjOV85wLmycj3ctbS4IY7KKu9Mag=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a7BgMrGtgZnxHAYWSt6S3/k/FkXM/xyFOY56aB6mNWaH59iedF30vLtmnsAne7bNK pKHgIPsdDoRnyTfZ8983ZTrMtZJvfYHnnPark1FEHJRh/BhMHtCldpFwiRsbWhGsNc nwnxYdF8x9KNOmpmWOAp4pzRESsYLYIpNOTVGbtY= Received: by mail-wm1-f51.google.com with SMTP id q15so4799684wmj.0 for ; Thu, 16 May 2019 14:00:27 -0700 (PDT) X-Gm-Message-State: APjAAAUBjSTGwqCe/qdEF1ZqxRBwT7UoKaAOJfxZmA4vAFSDbwBD5Azd Z+2Heca57Gtf13xsjxP35wm9ZJBXH6XbOyTB9S0mAg== X-Received: by 2002:a1c:9689:: with SMTP id y131mr30689877wmd.74.1558040425543; Thu, 16 May 2019 14:00:25 -0700 (PDT) MIME-Version: 1.0 References: <8fe520bb-30bd-f246-a3d8-c5443e47a014@intel.com> <358e9b36-230f-eb18-efdb-b472be8438b4@fortanix.com> <960B34DE67B9E140824F1DCDEC400C0F4E886094@ORSMSX116.amr.corp.intel.com> <6da269d8-7ebb-4177-b6a7-50cc5b435cf4@fortanix.com> <20190513102926.GD8743@linux.intel.com> <20190514104323.GA7591@linux.intel.com> <20190514204527.GC1977@linux.intel.com> <20190515013031.GF1977@linux.intel.com> In-Reply-To: From: Andy Lutomirski Date: Thu, 16 May 2019 14:00:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support) To: James Morris Cc: Andy Lutomirski , Sean Christopherson , "Serge E. Hallyn" , LSM List , Paul Moore , Stephen Smalley , Eric Paris , selinux@vger.kernel.org, Jarkko Sakkinen , Jethro Beekman , "Xing, Cedric" , "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" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 16, 2019, at 12:24 AM, James Morris wrote: > >> On Wed, 15 May 2019, Andy Lutomirski wrote: >> >>> On Wed, May 15, 2019 at 3:46 PM James Morris wrote: >>> >>> You could try user.sigstruct, which does not require any privs. >>> >> >> I don't think I understand your proposal. What file would this >> attribute be on? What would consume it? > > It would be on the enclave file, so you keep the sigstruct bound to it, > rather than needing a separate file to manage. It would simplify any LSM > policy check. > > It would be consumed by (I guess) the SGX_INIT_THE_ENCLAVE ioctl in your > example, instead of having a 2nd fd. > > Okay, I think I see what you=E2=80=99re suggesting. I don=E2=80=99t think i= t works well, though, since loading the data from the enclave file will almost always be done in multiple chunks, and it=E2=80=99s not clear when the kern= el should look for the xattr or what to do if the xattr changes part way through.