From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E441BC433DB for ; Fri, 12 Feb 2021 16:45:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24ADA64E8C for ; Fri, 12 Feb 2021 16:45:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24ADA64E8C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AEC4A8D006D; Fri, 12 Feb 2021 11:45:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A9C378D0060; Fri, 12 Feb 2021 11:45:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98C3D8D006D; Fri, 12 Feb 2021 11:45:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 83F4E8D0060 for ; Fri, 12 Feb 2021 11:45:29 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4DB68611A for ; Fri, 12 Feb 2021 16:45:29 +0000 (UTC) X-FDA: 77810191578.24.pest31_27153d727622 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 33E3F1A4A5 for ; Fri, 12 Feb 2021 16:45:29 +0000 (UTC) X-HE-Tag: pest31_27153d727622 X-Filterd-Recvd-Size: 3902 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Fri, 12 Feb 2021 16:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=iSTrcm/muIol9E+WsvT72floWDi3c8IA2lmQqRwQpME=; b=W0nFxrrfhnhDt9rmlvUTSEnd6b CGXv1z6QGqFcMHp0OnXDF+eXE45M92niL3340Tr716PldfAArAE2+015ceZzCE2rCWMxIo8L34hpS pOJ9isgy8nLKfsmtN8C6fTBdO4tMXZeRkSmvrEoEhwlmZ/eS53fEbYcPML/0ENrBKSVKHUHvrG/QC TiXy7gq6dgfhYfReDLc8JIDTWgj+hojZ+bWOt9XnKyeLQP9cEYJMnR9sTr6uxiVCszRYh4u14lPCn zc/pFqOhWt/lQRo3z3I160JeQ8XC5LlxSkE9OpQCEKTvHz+Jpn+ynDpLbkoS8NMXZZVsfKc+YYx+f 4Kb2l8iQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lAbZA-00BqrI-OS; Fri, 12 Feb 2021 16:45:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C85B73010D2; Fri, 12 Feb 2021 17:45:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B7ED62C1EF540; Fri, 12 Feb 2021 17:45:11 +0100 (CET) Date: Fri, 12 Feb 2021 17:45:11 +0100 From: Peter Zijlstra To: Joerg Roedel Cc: David Rientjes , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , "Kirill A. Shutemov" , Andi Kleen , Brijesh Singh , Tom Lendacky , Jon Grimm , Thomas Gleixner , Christoph Hellwig , Paolo Bonzini , Ingo Molnar , x86@kernel.org, linux-mm@kvack.org Subject: Re: AMD SEV-SNP/Intel TDX: validation of memory pages Message-ID: References: <7515a81a-19e-b063-2081-3f5e79f0f7a8@google.com> <20210212131907.GI5453@suse.de> <20210212145318.GK5453@suse.de> <20210212152813.GA28884@suse.de> <20210212161849.GB28884@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210212161849.GB28884@suse.de> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 12, 2021 at 05:18:49PM +0100, Joerg Roedel wrote: > On Fri, Feb 12, 2021 at 05:12:41PM +0100, Peter Zijlstra wrote: > > On Fri, Feb 12, 2021 at 04:28:13PM +0100, Joerg Roedel wrote: > > > I don't know the details about TDX and #VE, but could a malicious HV not > > > trigger a #VE basically everywhere by mapping around pages? So 'fail' > > > means panic() in this case, right? > > > > Right. > > To fail reliably, doesn't that mean the #VE vector needs to be IST? > "Everywhere" could also be in the SYSCALL entry path before there is a > trusted stack. I really don't want #VE to be IST. I really *really* detests ISTs, they're an unmitigated trainwreck. But you're right, if a HV injects #VE in the syscall gap and gets a concurrent CPU to 'fix' the exception frame (which then lives on the user stack) the handler might never know it went ga-ga. Is this something the TDX thread model covers? A malicous HV and a TDX guest co-operating to bring down the guest kernel.