Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1066902pxx; Tue, 27 Oct 2020 07:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4LDJ69a3qMkOAaF9kR55MycckuXuZ9E2aL40m44/Hv0hUV697AZWrvuZVkXOB7opNanhE X-Received: by 2002:a17:906:b24c:: with SMTP id ce12mr2638537ejb.386.1603809115546; Tue, 27 Oct 2020 07:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603809115; cv=none; d=google.com; s=arc-20160816; b=Bqv+kESee/XsdrdZDhk0yx+An6FBnFGn2vCt2d70hZTrEjSI1KeNJH63S2hutPvMVM yY+mU1B1zV59VsH8Sg9SChXRwsj7k9Tap4MKK33jgfDpFRMLTtff7eHsUvCXVe12ie3+ fkXOXwwWML6m7ZzWAXtwYZAUCI0UAoQUs1mjqHcUDHXHQSecfkbCAPv9wbeEG8kQEjrK jpMpCrww+SH6nmEqv0HWGXV/FXJgnlzXUAZbksbmAug3nMhbLljZwKLRKnO0xyejfJ0u B1dA7OyNqA04XTM+8zrUkJaISuf87Yu3IAoP6caKhz5R1+K1BHMbaU5twmfMxnM3ZuIY 5dSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oy9OJv4Ilp2FbiIIfueFPPqXC41PLYQruI/S1Nee75g=; b=rg+qxvZ8pdrKvgflgxiINc8B30k0gOV2KIb/0nFWVNJorlibnOSo3M4I7piJ84Eo+c ZKI+LW3tCYjUY0bnpyYU9/zjQDRnJ5hDjxmYsZ/9CQuXsuzyydDr8/AIgVXAWpAzFtzM WeM2R2eNISepuKluOjEqiS6+d2G+fM5vkUF7dOAjZQdQDw7HeBsZfIZJudkzIwqKzI3E iLnZ2mBCbqPHxSt4dxWcgDaHDITA8wbSZhCJsw4PQE+6PPEkAHHZUv5pCByMA889MoEZ tJjln00D2vloAxdSqqsPHMt28GdZ2V/rVM0053D8V7eYlRQrhB7JmCBKGhXpROTxJHRp vAww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=JOIotLan; 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 g8si1045421edn.330.2020.10.27.07.31.33; Tue, 27 Oct 2020 07:31:55 -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=JOIotLan; 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 S2897291AbgJ0KFb (ORCPT + 99 others); Tue, 27 Oct 2020 06:05:31 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41170 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896062AbgJ0KF2 (ORCPT ); Tue, 27 Oct 2020 06:05:28 -0400 Received: from zn.tnic (p200300ec2f0dae00bd0b3d5f265e51fe.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:ae00:bd0b:3d5f:265e:51fe]) (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 31B591EC02D2; Tue, 27 Oct 2020 11:05:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1603793122; 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=oy9OJv4Ilp2FbiIIfueFPPqXC41PLYQruI/S1Nee75g=; b=JOIotLanp8LQC81i6KLOL7OPwsvB6Ipaf6g2wcUL//ENzojc9Ei2180xRAPlgltTWMhf6U smKBTdNcj9G+kieuQ/+1kgtqrHzVE1egMdrJKjDSTW2hmYyyPMde6bgz51dblA8d7zEYhq naAgnvInCGouvjein6HyDNd618O5nCE= Date: Tue, 27 Oct 2020 11:05:15 +0100 From: Borislav Petkov To: Dave Hansen 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 , Sean Christopherson , 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, 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: <20201027100515.GA15580@zn.tnic> References: <20200617220844.57423-1-jarkko.sakkinen@linux.intel.com> <20200617220844.57423-12-jarkko.sakkinen@linux.intel.com> <20200626153400.GE27151@zn.tnic> <1ada871a-2350-1007-c625-a00bdb0d439b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1ada871a-2350-1007-c625-a00bdb0d439b@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 02:26:13PM -0700, Dave Hansen wrote: > What were you concerned about here? Was it how long the syscall could > take, or that one user could exhaust all the enclave memory in one call? More the latter. And generally, to have a sanity-check on all requests coming from luserspace. > Some later versions of this patch have a 1MB limit per to reduce how > long each SGX_IOC_ENCLAVE_ADD_PAGES call spends in the kernel. But, I'm > not _sure_ that's what you were intending. Yeah, that was not my main goal - rather to sanity-check user input and impose a sane limit. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette