Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp868007ybi; Fri, 14 Jun 2019 04:49:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTaMFqjPGwJsJEl8twaTWM9g0F0rBhWTacD5Xn7bp4Zqw8rtloFhb/+BISgparE5FJbhky X-Received: by 2002:a17:902:e2:: with SMTP id a89mr93685153pla.210.1560512972713; Fri, 14 Jun 2019 04:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560512972; cv=none; d=google.com; s=arc-20160816; b=yd8q8UHqok4hE3XSVU7MzMkrzX04oXBDj051oE8PbZ/pSXdx8YoLVpixkuX9GUbibB aEQe6UTa4AZHOa31OQP+/Zt7WXf3WAqLKyK6leytHN/ikPryovrQh2XacuteM8PZz2Jf 11FXdCCnBdYprIdPuJG15WZf1t5xA3+EJKZ4TOhvYocN/3XzhQ31qTNozNkD8Ss3Lllb yk1815WhThhUbh+NSTU/aOiWDN1QygQiztYEKfW+10zpfxRHGoB1iuw6P+FGRuTh4yKL Z6fsWtIbvYduKg/nQ6CaHZfxXZcXL404b7Sf5LY2HWwK46UoCnsmnbFsAwmxcmXb2D3z Mwyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=h/RkmMY6lU3xp3EMTfM5htXXlyGM/FqAFdB3EA1Y/ks=; b=zlTPTWJlAdZ5CeZKCm7IzpRsEs6IFKtc3Ceo2Hwj9OrLb5NpOgq01lpOAl64kX5nAW sXUbaDqLAatX66xUNn6CFHwOr4foKN3k39b/TUheENfa7SGxQ13zI8qGFHR37SxZj4sY qZGeobnzspnSRgeGTCi6hrCR9nEg0jhlcM4fAuIgkXKi7h+h32YcBn95Uu1FV3XmauwG nGigpIFwhqsjJRtn2Iwe+adf+nbdZ0jisUjFHw2TvyU4uSG5CZT5kqdgNOjOC4/K6CNS wrkyt6GMrqTrW3BZ5K3ixbPId6uOMfUAo9E9+anEcs9kuLuuITZY8+lqhRqKvOnqT4B/ R/5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Yz3VHco4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si2389548pgb.234.2019.06.14.04.49.15; Fri, 14 Jun 2019 04:49:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Yz3VHco4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727536AbfFNLrl (ORCPT + 99 others); Fri, 14 Jun 2019 07:47:41 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37920 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfFNLrk (ORCPT ); Fri, 14 Jun 2019 07:47:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=h/RkmMY6lU3xp3EMTfM5htXXlyGM/FqAFdB3EA1Y/ks=; b=Yz3VHco4uNAMcgPZbDG6qh7er eyVNjQVW5bYjEJukcYBJwivb4xqu5hgxItRTEdKs4buH3AXHlovCUsFgM4epbNxV0iY5ba0uMHMZ8 CWCiINOZTNYV1VwpSzAcQDDfhTRSGKCFsJEhqtW97Rtrkv8ZjURnPLimYnmBvbqSPmHCgJ1bTkjjR hbIq33RYkrsI5a/5ZgK75sZ9yi5LdcQI1hG6R04omFQLTtocKREkBmYuc2ZRr/ixVqQkcqsXUwbTS KI8WzFSOe2tswjzNVG9vd58kOfnWxDuMA8G+6hbedadtDIlIEo/qgiEU3fgjKgKRxFfoCdLXeH/Dj LrbNR3Ebg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hbkg9-0007LF-S6; Fri, 14 Jun 2019 11:47:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9FD0E2013F74A; Fri, 14 Jun 2019 13:47:32 +0200 (CEST) Date: Fri, 14 Jun 2019 13:47:32 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Andrew Morton , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Andy Lutomirski , David Howells , Kees Cook , Dave Hansen , Kai Huang , Jacob Pan , Alison Schofield , linux-mm@kvack.org, kvm@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH, RFC 45/62] mm: Add the encrypt_mprotect() system call for MKTME Message-ID: <20190614114732.GE3436@hirez.programming.kicks-ass.net> References: <20190508144422.13171-1-kirill.shutemov@linux.intel.com> <20190508144422.13171-46-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190508144422.13171-46-kirill.shutemov@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 05:44:05PM +0300, Kirill A. Shutemov wrote: > diff --git a/fs/exec.c b/fs/exec.c > index 2e0033348d8e..695c121b34b3 100644 > --- a/fs/exec.c > +++ b/fs/exec.c > @@ -755,8 +755,8 @@ int setup_arg_pages(struct linux_binprm *bprm, > vm_flags |= mm->def_flags; > vm_flags |= VM_STACK_INCOMPLETE_SETUP; > > - ret = mprotect_fixup(vma, &prev, vma->vm_start, vma->vm_end, > - vm_flags); > + ret = mprotect_fixup(vma, &prev, vma->vm_start, vma->vm_end, vm_flags, > + -1); You added a nice NO_KEY helper a few patches back, maybe use it? > if (ret) > goto out_unlock; > BUG_ON(prev != vma);