Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3346047ybk; Tue, 19 May 2020 02:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTx0W73f6Ryr1rjslTwxjrO9u8AAr+BHcXf2EclbZYta+FWX9cVUw2dGegoywpCjREU9ml X-Received: by 2002:a50:ae02:: with SMTP id c2mr16622158edd.373.1589879853183; Tue, 19 May 2020 02:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589879853; cv=none; d=google.com; s=arc-20160816; b=Gg9cI89xN/uLJzAsTuaT90lcAw3UZwLQ5Z5MtdP7Ns7F+udkXZh5L7QbEcAATBPmBS +Y2evzD+QTBGqQu+5nyyico1Khqa6mlZ7WGleXJi+hcMH6iAdrW3rU6pi1wJsU0Je81x BB6RADkOOjhXucOWHqyj1NiQuVzZdJWcC+lcu6z31NnVKOT5pOArPREZ6k2JbsVW4/fZ fWO1R9HL3EwqU1c2TJhg8YYVlw0cRCJ4ezZ6Fi+f2TyAURP6aBB5RvkEGb/9xJCYFic1 nCG3to27M61z4xE0Cul9b6qwkQaMW6qFInTUJMfbhM+uOLBB6OMl9ssMRSR+B3jgAqnc EV0A== 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=3zIW0mscrSzBoJoj+N7Op6mZu6eLSey92yt+pTI7244=; b=Wpkq/SWymOQeL7/1o5q/CCklSyCEjuIySQwQ4P/XCpGOp9vQWt3e/oSA3vXOf2F0lr G8MGF4Akoa8SzoZ5v7KmXx9i+b5xpyyJmL/hFx3ZbrNgBVF8Ar7urZYJbo6ZdrLIFfG9 AbFXdiDxaJebWVHVIyVoJ1FhhgqbbHFoiS++0zMLiDRM6WXktAg4ceA4vDKfn+9gioQ4 uiT9eKijjpN+Uyo7ccBdG3An+VR3EXggZhd0ZIx9rHGg+UqJKB6E+WnWvloTcQM6Bm/O GEzpsVrN2mmID3VFrQcaca/qjo6S8i/ktmLwYDtY7H4FrhBBaBMW7rI7voh6wE6ShTXR gDsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=UCHDF2Zg; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si8000593ejx.94.2020.05.19.02.17.08; Tue, 19 May 2020 02:17:33 -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=@alien8.de header.s=dkim header.b=UCHDF2Zg; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728515AbgESJPg (ORCPT + 99 others); Tue, 19 May 2020 05:15:36 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57080 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726818AbgESJPg (ORCPT ); Tue, 19 May 2020 05:15:36 -0400 Received: from zn.tnic (p200300ec2f0b87003113f65f16dcf690.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:8700:3113:f65f:16dc:f690]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 99A811EC0322; Tue, 19 May 2020 11:15:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1589879734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=3zIW0mscrSzBoJoj+N7Op6mZu6eLSey92yt+pTI7244=; b=UCHDF2ZgyRLRTP7XNdnuIZv4h2qPUWVp7D7heCzAdEWdt15yHiKvQO71Kib2dI9IztD8je 0XrJlp8xpdDb5g8DZ7zW5IDgqVo7PX01g/D/UXElv00ZpVvJMc6eM9sQURxg+yMMLTb+Sd 4Qav+EDQoW5GfHKrvicE0mYg0jJJncI= Date: Tue, 19 May 2020 11:15:26 +0200 From: Borislav Petkov To: Joerg Roedel 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: <20200519091526.GB444@zn.tnic> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-36-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200428151725.31091-36-joro@8bytes.org> 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 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. Also, it generates the checking code here only with CONFIG_STACKPROTECTOR_STRONG=y > Make sure the early code is compiled without this feature enabled. If so, then this should be with CONFIG_AMD_MEM_ENCRYPT ifdeffery around it. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette