Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1169024pxk; Fri, 18 Sep 2020 05:46:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqeJa89JyxOFICRRC2YfwGfKD3zCTwV+xbdhAzona8S0SQ7szzkS7AtluiV+JlLT1e4DTj X-Received: by 2002:aa7:dd0d:: with SMTP id i13mr38834587edv.314.1600433208249; Fri, 18 Sep 2020 05:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600433208; cv=none; d=google.com; s=arc-20160816; b=y2BOVXxEUgBuQDIyFOJz5aERax5+gi7zbPGv6l51V46xgb7xnZE7NtdSEjh/9RKNS8 dvrr9ll7e1J8ziacu+071xHwwHhxb6Bt+ZvUyJrp4QqaidYLagq0SDAb+2OQp+Ojj8z1 gYrPuC5a0g/h4gt4nOTKrW7ZW7I/kYOKXvaqghfuOs1xDDkkEaAJ/AAsCkvvasRFXAhq fqbp+mPgStPmiirgOCo09G83slvuD4H7rmVrnFXV79CRs8KRmE7s71GnmekmIFChmYI1 N6RtYrzWxPkElcF2Ea0vvDyi4VRn/KAkhckRUOy209cPwF0nnvf4/6tOLQ2MZ/+AOTPy G+Kw== 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=0lmOLysLQ+g/n9VuSWmaXFxfGPTJZgJcmn67WgVbx/0=; b=u1Jd+S2xxtZ8zzoreorsjSy1QVSjwClAAKfGf/MHlb8dVjlf0hGZuvoUK0YzBWirFP P5zGAQU1baHXDRPMH2iKTO/fnicAsRY3OUsHN1kHvdRMd1I/7wP8wTvha/4/uEsUK/wF rHKNVfVXUiYbass8U/XPg2K8PctTcRPddaDuFf+FyNx5vKuYfzwEj5rhc+ROH5cnyKJ8 0J4BYgyVezByKPGe2YtxK4X3vNNPPeLcumiscBbgfkZZNxVaPjIcg5UcJzQE3Ef+EC99 AIk8CQHSQehQ0iVgdkjoTmvYdgZrYfAZxgsZ22GE45zTJNS5i7RDrqo7Ze3IferU8oKc /ACg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=rPJL6Xtb; 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 dn20si2566943ejc.342.2020.09.18.05.46.24; Fri, 18 Sep 2020 05:46:48 -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=rPJL6Xtb; 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 S1726497AbgIRMot (ORCPT + 99 others); Fri, 18 Sep 2020 08:44:49 -0400 Received: from mail.skyhub.de ([5.9.137.197]:49656 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgIRMos (ORCPT ); Fri, 18 Sep 2020 08:44:48 -0400 Received: from zn.tnic (p200300ec2f0c260019740fa9eb38b2dc.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:2600:1974:fa9:eb38:b2dc]) (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 0CBF51EC032C; Fri, 18 Sep 2020 14:44:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600433087; 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=0lmOLysLQ+g/n9VuSWmaXFxfGPTJZgJcmn67WgVbx/0=; b=rPJL6Xtb1kMyeFqMJKaVO0B5d0L5tzpJQdZHLU2aujxhAVKH09FIHwaIIArrPPZM0hHf9D /1BBOeITxJ1GZoZg4Q7tkg29RGdIP+JAbER8a3gQrAyaniZ+merMb+jT44LOvOFEKBb1x4 zp1O8L+0fhq+F074E/orFhvOhKmWI3o= Date: Fri, 18 Sep 2020 14:44:45 +0200 From: Borislav Petkov To: Jarkko Sakkinen Cc: x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Jethro Beekman , Darren Kenny , 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, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v38 10/24] mm: Add vm_ops->mprotect() Message-ID: <20200918124445.GE6585@zn.tnic> References: <20200915112842.897265-1-jarkko.sakkinen@linux.intel.com> <20200915112842.897265-11-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200915112842.897265-11-jarkko.sakkinen@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 02:28:28PM +0300, Jarkko Sakkinen wrote: > From: Sean Christopherson > > Add vm_ops()->mprotect() for additional constraints for a VMA. > > Intel Software Guard eXtensions (SGX) will use this callback to add two > constraints: > > 1. Verify that the address range does not have holes: each page address > must be filled with an enclave page. > 2. Verify that VMA permissions won't surpass the permissions of any enclave > page within the address range. Enclave cryptographically sealed > permissions for each page address that set the upper limit for possible > VMA permissions. Not respecting this can cause #GP's to be emitted. > > Cc: linux-mm@kvack.org > Cc: Andrew Morton > Cc: Matthew Wilcox > Acked-by: Jethro Beekman > Reviewed-by: Darren Kenny > Signed-off-by: Sean Christopherson > Co-developed-by: Jarkko Sakkinen > Signed-off-by: Jarkko Sakkinen > --- > include/linux/mm.h | 3 +++ > mm/mprotect.c | 5 ++++- > 2 files changed, 7 insertions(+), 1 deletion(-) Needs an ACK from an mm person. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette