Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1391747imm; Thu, 19 Jul 2018 00:23:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeGTGM6anvmrXfqopNBTkss1hTpOsovBYunrrP9f5sLxf7Ni1xy0m+9LDQEIzH5/DLE0hM6 X-Received: by 2002:a17:902:7581:: with SMTP id j1-v6mr9058902pll.218.1531985003363; Thu, 19 Jul 2018 00:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985003; cv=none; d=google.com; s=arc-20160816; b=qeAag7eTvp7FtD5RSwGyw3tPKw+4eTzT2s0JyW3bjileQCgwUJcuXj7vMmRGVoKJnh qC8AkUO+J78ReWlq23T+qFn1v5joCC8JkPjlpKz+rpS7wS/W6H/rAVGUHJgbXZ8ark9m vwMhfjvrjGgW/O+O/AKO6rTqff7aNIne07Y+7JwsCb8lxCLxyG8xFgjq8MDZBZ5D6jOg /70+SrJInahxAkNTMoetWlBP90UG+z9GF5L0wnZ+ZOUSliAF73Ro7C5V/STtfHCPKSWU zqjbrVcIZg+hVfN9JVB/arhgvceUgQjZUnPd7SP8szFDWDq7j9EPL+IJhQSig3g6O3AD Y32Q== 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:arc-authentication-results; bh=CQnIrC/UF3jw2Pp17aC6lk4RP7cOOWSL/mYL4siOjeM=; b=VWdccFfZ3U7paIa+VwmBRjODouD1rcpzM9xqNe4yJKKUm8cXlbbhukbDs8Ta+vcqsj sGjHw6Dxa0UigOGa5EQ7VcW6Mklm19pPxLKgf+0dXx/GvcHvwdyRLdbowBegWy7egVYY 9tzua7gMBz4jwLiHDlpF2yLA48GlVVe8X4viDJOXMyj1jvvX6EYx/SS3jCScCORg69h6 b7INXhYG7oLZI6FMrBC8NFkndKtLU3PTbyQEdWwqZpH3RhrWynkyoLRtaNRaELvl2/kc bFkc0kQMyqGt5bXOrRQ3G0TT7gQ5pSSCG8TKgLI32jlGI+eKgmod0djFzj3Kt+2UGS3x DaYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=0SLvjTn9; 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 j185-v6si5560601pgc.419.2018.07.19.00.23.08; Thu, 19 Jul 2018 00:23:23 -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=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=0SLvjTn9; 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 S1730358AbeGSIEP (ORCPT + 99 others); Thu, 19 Jul 2018 04:04:15 -0400 Received: from mail-pl0-f53.google.com ([209.85.160.53]:46686 "EHLO mail-pl0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbeGSIEO (ORCPT ); Thu, 19 Jul 2018 04:04:14 -0400 Received: by mail-pl0-f53.google.com with SMTP id t17-v6so667047ply.13 for ; Thu, 19 Jul 2018 00:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=CQnIrC/UF3jw2Pp17aC6lk4RP7cOOWSL/mYL4siOjeM=; b=0SLvjTn9qryo7iJhVB424QYE0aaGBCFoxvaRHPY0Ds5DwKxp68+HwFWONLVSnXDTE8 P/0H8/5JuhUed55jB01NhnADn3n4/Tt0obJfldtsLtDc7zFyGbaHKQjsPXve++25WAnF oIOkQgsOMMO74CakxyyRS3hZvi7wkHAxQvHfac3/tvt9pijrNHoTl/0QCSSWQYCNK8cT hyItoOVdWa9Q7600lmG8rI4YU/diCKs5kxcFrenqYWiUBdAhJ4QQGSU4+wFLaQamSTZc hfFHT+JoaFM1AUdrgG+81gc0EbYE0u9Rl6l/MaVjqAEbPBrPT8R6AgfB8i/JoIwFmrX4 NH7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CQnIrC/UF3jw2Pp17aC6lk4RP7cOOWSL/mYL4siOjeM=; b=iw69u29+0M1AMk6O15QEXmbGMzpVBff/K80EDLu/IpTe5rwn5Vu3s7v/rzeYU+5Ur1 11CLKlT+N27CzWeGCCN2JEQR5cl07FnNqHXmd1JkFfOCmYnB3SU9kWdhnbkfSZT5ncqs 7JRX48Bot8xEehUhwj+ocSadIK5rk/VhClJqvUU+QIo0E9TDfUNN2khdwMsUbGbQFG7X bwoxmI3KcjmRIvEHteKqRAFchcHBQ05t8ZNymk6aP+Tbcqe5J/t/n5zsxw0Uox7R4V4t 3tOHVsGGKTZVMMUYOSZa/si5i8Qawnfk8pc5syTGgV+R3+/2EW446/O5F7AWBRabnCKQ Wd7g== X-Gm-Message-State: AOUpUlEY3tOogxfUjmh8xQkdSorm9ZfB4ENKVoUVeSH0TsS0Eis/Ajnk K3tYl/Rk1ckDHDpJaa5AugyA5w== X-Received: by 2002:a17:902:981:: with SMTP id 1-v6mr9108153pln.11.1531984953178; Thu, 19 Jul 2018 00:22:33 -0700 (PDT) Received: from kshutemo-mobl1.localdomain ([134.134.139.83]) by smtp.gmail.com with ESMTPSA id p62-v6sm8289481pfb.58.2018.07.19.00.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 00:22:32 -0700 (PDT) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id BE0913001F8; Thu, 19 Jul 2018 10:16:06 +0300 (+03) Date: Thu, 19 Jul 2018 10:16:06 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky , Kai Huang , Jacob Pan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv5 02/19] mm: Do not use zero page in encrypted pages Message-ID: <20180719071606.dkeq5btz5wlzk4oq@kshutemo-mobl1> References: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> <20180717112029.42378-3-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 10:36:24AM -0700, Dave Hansen wrote: > On 07/17/2018 04:20 AM, Kirill A. Shutemov wrote: > > Zero page is not encrypted and putting it into encrypted VMA produces > > garbage. > > > > We can map zero page with KeyID-0 into an encrypted VMA, but this would > > be violation security boundary between encryption domains. > > Why? How is it a violation? > > It only matters if they write secrets. They can't write secrets to the > zero page. I believe usage of zero page is wrong here. It would indirectly reveal content of supposedly encrypted memory region. I can see argument why it should be okay and I don't have very strong opinion on this. If folks see it's okay to use zero page in encrypted VMAs I can certainly make it work. > Is this only because you accidentally inherited ->vm_page_prot on the > zero page PTE? Yes, in previous patchset I mapped zero page with wrong KeyID. This is one of possible fixes for this. -- Kirill A. Shutemov