Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp582535ybg; Wed, 3 Jun 2020 08:23:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymOTbDPZL9qfRIYr5DofGWiwrv6vsT1xt/ZAEgdT/tIKvBdByDJCgO0LcFdDYbodDdY18a X-Received: by 2002:a17:906:af4d:: with SMTP id ly13mr14207127ejb.250.1591197814531; Wed, 03 Jun 2020 08:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591197814; cv=none; d=google.com; s=arc-20160816; b=Rha15oR49et3gcMzb9nyrPR/5EMDKyn+cX3zwi5G57Xe702E7uS94DICM16ff9y5Cs yuiKHPd6H7W6d9DCfktCHoKqZlYVRIvHMW2SHOP+8lWwFxYvLIDxuOl9PT4oop+rXePj NUzLlKPutzYruFKkMioEagKLKYop15C7PbvhDNPILC5Y83oKlVxhvCYHr2OkfBpOWLz+ fLrdsZORwyKpoUew6TVnv4U0O7moqoQBCxwhLxfW6f2vWAEKQYy8mvnQXX3LsCYfcg/1 VUQBV6oBYBufjbkhCr3Z8tnwVbhNQgPnSGnSYr9FJdYuXVdwVDmGDpHdksPm6hRY+cle vUGg== 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; bh=VCLgzD1e0uZL0H+EICxCl0iGDBpQpnOq2Iu45E+1Obc=; b=hZPs5DGv9z9zok3Y+POVPNJlSy9ZGqWp/vrrCfe6FBAGp1HK7a0v3GkKJNQ8/CFQZ6 gZRy0C4Qp624SNgx5DaDcH29i9s6uqTUF5av7G3wEwI0Eo1TU+2lmHhClEdlltTPjckU QglZwCbrO4wkQmqwjROB3+2Zwrk26i3ShNnwuomw87HmxHx78pgBUNhCH19KRWTVADnM qGQErF1KgahU+W45Ek2toZ3o+oa9A2b5GqyNIQC7bOhZndvofBRoCW1jro43RWgf6Est 4IPZkeZG3nNnGmIopdhqpEzA5IQxtANw1loKdeSXA0AhvjUcRFink6+DnYtfZFQzQhhQ UnFA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc23si1453669edb.115.2020.06.03.08.23.10; Wed, 03 Jun 2020 08:23:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725961AbgFCPVM (ORCPT + 99 others); Wed, 3 Jun 2020 11:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbgFCPVL (ORCPT ); Wed, 3 Jun 2020 11:21:11 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E784C08C5C0; Wed, 3 Jun 2020 08:21:11 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 9CA3B28B; Wed, 3 Jun 2020 17:21:09 +0200 (CEST) Date: Wed, 3 Jun 2020 17:21:08 +0200 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v3 35/75] x86/head/64: Build k/head64.c with -fno-stack-protector Message-ID: <20200603152108.GD23071@8bytes.org> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-36-joro@8bytes.org> <20200519091526.GB444@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519091526.GB444@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 11:15:26AM +0200, Borislav Petkov wrote: > On Tue, Apr 28, 2020 at 05:16:45PM +0200, Joerg Roedel wrote: > > From: Joerg Roedel > > > > The code inserted by the stack protector does not work in the early > > boot environment because it uses the GS segment, at least with memory > > encryption enabled. > > Can you elaborate on why is that a problem? > > The stack cookie is not generated that early yet so it should be > comparing %gs:40 to 0. Yes, and when GS_BASE is 0 it will dereference NULL pointer, which generates a page-fault before the kernel is able to handle it. Joerg