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.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 280BBC32789 for ; Tue, 6 Nov 2018 17:19:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E74D320862 for ; Tue, 6 Nov 2018 17:19:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E74D320862 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389584AbeKGCpX (ORCPT ); Tue, 6 Nov 2018 21:45:23 -0500 Received: from mga11.intel.com ([192.55.52.93]:57795 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389427AbeKGCpX (ORCPT ); Tue, 6 Nov 2018 21:45:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 09:19:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,472,1534834800"; d="scan'208";a="106372057" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.154]) by orsmga002.jf.intel.com with ESMTP; 06 Nov 2018 09:19:10 -0800 Message-ID: <1541524750.7839.51.camel@intel.com> Subject: Re: RFC: userspace exception fixups From: Sean Christopherson To: Andy Lutomirski Cc: Andy Lutomirski , Jann Horn , Dave Hansen , Linus Torvalds , Rich Felker , Dave Hansen , Jethro Beekman , Jarkko Sakkinen , Florian Weimer , Linux API , X86 ML , linux-arch , LKML , Peter Zijlstra , nhorman@redhat.com, npmccallum@redhat.com, "Ayoun, Serge" , shay.katz-zamir@intel.com, linux-sgx@vger.kernel.org, Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Carlos O'Donell , adhemerval.zanella@linaro.org Date: Tue, 06 Nov 2018 09:19:10 -0800 In-Reply-To: References: <20181102163034.GB7393@linux.intel.com> <7050972d-a874-dc08-3214-93e81181da60@intel.com> <20181102170627.GD7393@linux.intel.com> <20181102173350.GF7393@linux.intel.com> <20181102182712.GG7393@linux.intel.com> <20181102220437.GI7393@linux.intel.com> <1541518670.7839.31.camel@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-11-06 at 08:57 -0800, Andy Lutomirski wrote: > > So I guess the non-enclave code basically can’t trust its stack pointer > because of these shenanigans. And the AEP code has to live with the fact > that its RSP is basically arbitrary and probably can’t even be unwound > by a debugger? The SDK provides a Python GDB plugin to hook into the out-call flow and do more stack shenanigans.  From what I can tell it's fudging the stack to make it look like a normal stack frame so the debugger can do it's thing. > And the EENTER code has to deal with the fact that its red zone can be > blatantly violated by the enclave? That's my understanding of things.  So yeah, if it wasn't obvious before, the trusted and untrusted parts of the SDK are very tightly coupled.