Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp78429ybh; Tue, 14 Jul 2020 18:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydqeUovRSqCj9vKxjn99yfpOCRw0wqgQfXWSUQJqk3gZcX6A5OZ7nqaUY2i2NdESpapIRQ X-Received: by 2002:a17:906:69d3:: with SMTP id g19mr7363814ejs.402.1594776638663; Tue, 14 Jul 2020 18:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594776638; cv=none; d=google.com; s=arc-20160816; b=nH6jLDoRo7ZP9vMXw/QFnRR0riEgvzGmhgZzkioUC0cpsS/WC21IZ5KPaRQ6NgAyTh s+6IS+23EMx1c61SLnFF1JqMwEg3qwOQ58/0SB+ApDrwfyyaVC03YZyqfL+2QwrD9BNt 20lpGxXSrtQusfXx1ZacC8VCp4Goq7T5hW+SUYn2802GvillrwuHfA62wqMGEVYe7ovA z1Weaj3V1uF67PdWOuHnjG0Nn6WjoUSR3sEDdWgSyWFGV5zi55Y6aRCAOfFLx+1Wnpq+ B7BRa4sPhWkKERd4zGIbtoggWs+1l4wMxmN7YRDS600o1UtwNMKCYf74ifNLwxfVpvHJ o/Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rBR5AjI82R5bYhOng71+5jFKvQ0oN6P/Kk11F4Z3+zk=; b=OzKi6n5jZebraWdLnmWpYrPxtJkgcYehwD41g7OzvVZt1p649UFjRrz4c8yPOveg/v QjqlhP+jq0j4sSV9SZyNFO14oDLme3bWpsGRgmgVQFl49RZXpZImTFbuYUsYIJK8Mdq1 LVWPLqcSdAbmKteT7NV6lhpsTvUn4Kb6Ohvkd2S0r3c3yHehZKxVIGcjR9sWX9PPkhnr eoAw624UCW9GmzP+2PaRgOQLn0jkhf1viK5zXojOlFPU7Llu31oBxMfSJsWpWGcWSdFZ 0mvDJHkN2lR/9w29RhCnPIiRnjRcjUUw8fggArlAjlo00btkHaxftz80kLBngYsz7Yzm ldOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=n+kU5hvp; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si318069ejk.32.2020.07.14.18.30.15; Tue, 14 Jul 2020 18:30:38 -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=@chromium.org header.s=google header.b=n+kU5hvp; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbgGOBYK (ORCPT + 99 others); Tue, 14 Jul 2020 21:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgGOBYJ (ORCPT ); Tue, 14 Jul 2020 21:24:09 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C120C061755 for ; Tue, 14 Jul 2020 18:24:09 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id w17so694302ply.11 for ; Tue, 14 Jul 2020 18:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rBR5AjI82R5bYhOng71+5jFKvQ0oN6P/Kk11F4Z3+zk=; b=n+kU5hvp8QX2eErdqh0W7QLokIV7OjxOGug3362dtYmAU15jXA2quaw1LOjlA2OxHr grTkzjMkDFKiGgnsiQ1p2YDXLg3DuC9x59mWeMy98rbQ5Kngg7FI+StxG6d9e+/dJMkM ujFENwTUf9nN1xF3xXq+X+clzZw1jOue0CTl4= 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; bh=rBR5AjI82R5bYhOng71+5jFKvQ0oN6P/Kk11F4Z3+zk=; b=IjdSoJBIpIOiV7DJWIVdmvb0vkXJG6ynvivbaMSr15wx1hV9IVprt5nsCe3sGCvJ/7 uWXBPZLp4xGh/nU4UpnWs1KSC7ejrBruqPV/wmXbYY9I8Mj2COFn/cuMIJjWGPLRD2zZ 2ln3FUcI3zx6SDq4wAMqFBAJ0FdEzgP2ZY2GqAOaYmw7eWCYIVcREPlgbntR4UHulY2p C+zgxN5oryanqoX+2n8V7mXRExcyVBgs81jsnuw9y3E1uKguljAc9+qhLkljZkBRaMfe PN2jeGct/6Bi2zfYO0PNKUOj0+tMaSyHGPI3DgNJXRShAPdcsGCspJeOAib/9WTIN9gR B9kA== X-Gm-Message-State: AOAM531lDGDY5bgmg7IiCmibVcbhXP+R4BWSOY863lAm5Hjwb7JVn+al TjC/+DvvMhx7KLK9kNMl8GF6dg== X-Received: by 2002:a17:90b:243:: with SMTP id fz3mr7470339pjb.17.1594776248812; Tue, 14 Jul 2020 18:24:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j13sm263522pjz.8.2020.07.14.18.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 18:24:07 -0700 (PDT) Date: Tue, 14 Jul 2020 18:24:07 -0700 From: Kees Cook To: Joerg Roedel Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v4 14/75] x86/boot/compressed/64: Add page-fault handler Message-ID: <202007141824.C00ADEDC0E@keescook> References: <20200714120917.11253-1-joro@8bytes.org> <20200714120917.11253-15-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714120917.11253-15-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 02:08:16PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Install a page-fault handler to add an identity mapping to addresses > not yet mapped. Also do some checking whether the error code is sane. > > This makes non SEV-ES machines use the exception handling > infrastructure in the pre-decompressions boot code too, making it less > likely to break in the future. > > Signed-off-by: Joerg Roedel Reviewed-by: Kees Cook -- Kees Cook