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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 4999FC433DF for ; Fri, 26 Jun 2020 14:20:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18CEF20E65 for ; Fri, 26 Jun 2020 14:20:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="g2x5K1KZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729055AbgFZOU1 (ORCPT ); Fri, 26 Jun 2020 10:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgFZOU1 (ORCPT ); Fri, 26 Jun 2020 10:20:27 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 076FAC03E979; Fri, 26 Jun 2020 07:20:27 -0700 (PDT) Received: from zn.tnic (p200300ec2f0d1400a54547ceb629f080.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:1400:a545:47ce:b629:f080]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 20E321EC030F; Fri, 26 Jun 2020 16:20:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1593181225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=vmj+04bFDkf6c7vKbF08257n3LmOF6+ZWPH64rT2gqg=; b=g2x5K1KZhGeWx7TL+fAXs7iOxbPve1ne4R+9ZE+/tGPuLXt8GcdjlvOzd35VHUkgXxmV3G VhWibE2jR939faBICh3YbLwz1LDw4yITMw7pz4Wzk71PniuZD9kiUwvhkIeGuk2UEMJ6WF WzVVwQ+U8dKbm9NOZ8VlXHHP3rqlO/0= Date: Fri, 26 Jun 2020 16:20:19 +0200 From: Borislav Petkov To: Sean Christopherson Cc: Jarkko Sakkinen , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Jethro Beekman , Haitao Huang , Chunyang Hui , Jordan Hand , Nathaniel McCallum , Seth Moore , Suresh Siddha , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, josh@joshtriplett.org, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v33 11/21] x86/sgx: Linux Enclave Driver Message-ID: <20200626142019.GD27151@zn.tnic> References: <20200617220844.57423-1-jarkko.sakkinen@linux.intel.com> <20200617220844.57423-12-jarkko.sakkinen@linux.intel.com> <20200626091419.GB27151@zn.tnic> <20200626141627.GA6583@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200626141627.GA6583@linux.intel.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: On Fri, Jun 26, 2020 at 07:16:27AM -0700, Sean Christopherson wrote: > That being said, I agree that it would be safer to move sgx_calc_ssaframesize() > inside sgx_validate_secs() and only compute encl_size after the secs is > validated. Yap, that would be the right thing to do. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette