Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp611430ybt; Fri, 26 Jun 2020 07:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz5/a9LZJ9ILa+s0S/DOdtxXNpAhkizknebdgqwF0A23zFvgSgGa6Nbr5dwZUX2QCUGvK4 X-Received: by 2002:aa7:d845:: with SMTP id f5mr3545355eds.162.1593181370640; Fri, 26 Jun 2020 07:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593181370; cv=none; d=google.com; s=arc-20160816; b=ai82f68W9P2KAwTQpZe31d/tNJguC7c7Wvtw/yPcw9/pqzXsrMQ48d84sDAldT5Itz 9A+oCxpJ+bvzDulZQ77Zr5L3H5xHAyVwVbgtfwqWCn82rdrFBX1OJs71vXWDPPzJpll6 wuaCZJO/3UxMDv0jeXdBXq2Q1XCF5xuC9NphQeaBfJAp2dgNzj07tp6rhzfWmnHDajOy 73+zt6a6aP85/BrAAUFstcOO9xYIVGOEZX27OoyMEjcPjEkL42lRCj7RRSIrF9fR2Br8 yErnhVzFa5SJf//SHOVwQBhdD/PzXKhm+J1D40MZWtQek7W13LpSUgvkxGgGNCXU/Prf elgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vmj+04bFDkf6c7vKbF08257n3LmOF6+ZWPH64rT2gqg=; b=bznaOu94TAPtADMSNGQjICtemoiweZwLkEgOU/PMrO/bKusczxAY7OLfXoaWzEWKc4 PM6UYp+kqSDK0EI0cFsAD3BVR+wJ/nUZgbKmAcBfW8bQVHZneBy4gxdaK3TQy46pbliG MHp6twqEGiAr5jkoNKYuSQjN6Qdh5arX7q9Ms/mOra/9MBpRm/kvghc/w4wAnGILOTwN g1zGIK52cUUnkp9vHHmIV9Jxm4NRcY2Ek47wIEfabynAfnpzM5/0Grj+7P14B5NhGtjm s4cvyRno2rFJX/U5DoEhSZ9ab+Ku8LLV+HotbZbMgpNzviZSkhQfqivWbOMhROzzM775 9xDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=g2x5K1KZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zg6si10807483ejb.108.2020.06.26.07.22.27; Fri, 26 Jun 2020 07:22:50 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=g2x5K1KZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729075AbgFZOU1 (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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