Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7251674rwb; Wed, 23 Nov 2022 04:21:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf7M9EDY9oMwILmk6+Jbu3SAghH/Nl5ZrLLJLfLesEXdrTgNL1WbDv81TAJBD+cA/Pper7Lp X-Received: by 2002:a17:90a:4b4d:b0:218:b2da:1091 with SMTP id o13-20020a17090a4b4d00b00218b2da1091mr14990248pjl.154.1669206094571; Wed, 23 Nov 2022 04:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669206094; cv=none; d=google.com; s=arc-20160816; b=Xi4OUscnozTHGdOFO0VairZ6GCV1Ir98Geet7hwGgliuKeD0xGnXidFuYFdTHkqQQO 7jOD7hkEB4w46tE7X4i79VcsDX1qA71OkaHBY8oXjESKZmLjT0b4ZaC19VQyaRf1Q9Q4 052ETQsfs7JurGtGjnlEhqBY6apnFZHTufd4xx9nI9d0UeGsgoIie7Ch5yLcBiNVVXzZ Jm6tNZY8325doRT4ScK0RHIGGl1XWhMllk0UZKBuTqurU0wrVDckzo8+fRdSIi9zwwJV K/ahucwFcPPNZPIlVWihGfIitKgvQaceekIoBRlsNs8j8GY6U4u75q1hGON6tNeyxq1P dLzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Je7PCOr7h3btmMnUFWEHR7IqjkRixXwbZa0p/sBqG3s=; b=vRMoPm8fc0hPA/UUM5A9iMrTzSk9hpu8OSgUBrdFESezkJbvNux0lMQNmJqSrtyRzs K4lWtwluSg0KztNyi3Ot+9/QT8Il6+gShE7G9yILydrUoUM/1PyaEs3+kL5jPLEOOgGA N3Jv9pTFNJ/EKBdYT+NpKJk89zqDMkYUV/PX2NiktpnssANi/EFc9caIOi9juVlKXMkq eslh1j+NKlLLzrKcTFxRl1qoS3LKw1R+Akyzr9sTSHIXcRck3GVe2bGPnMIewY2tTl9F b1wMuvoxwnNRo/whDRhBzI1AbGa7BwKRXGOoJFasGYRlixtj11hDtpAy7kF+HygtCQjR BJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EM8KLLu9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a056a001bcd00b005638dc03ab3si15508114pfw.323.2022.11.23.04.21.20; Wed, 23 Nov 2022 04:21:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EM8KLLu9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236570AbiKWLLp (ORCPT + 89 others); Wed, 23 Nov 2022 06:11:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236973AbiKWLLG (ORCPT ); Wed, 23 Nov 2022 06:11:06 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B64F241A; Wed, 23 Nov 2022 03:09:13 -0800 (PST) Received: from zn.tnic (p200300ea9733e747329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e747:329c:23ff:fea6:a903]) (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 3D1B11EC0409; Wed, 23 Nov 2022 12:09:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1669201752; 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=Je7PCOr7h3btmMnUFWEHR7IqjkRixXwbZa0p/sBqG3s=; b=EM8KLLu9Px4fBxk3iA86XDYA+m4/+Vlt9u/w+z48SKxn25mmzmrJyJtWSBkmD7hzFuF17o 2jeEV9BhaQqFQmcTTX+YIdNLY14uKaO3aP68Q7vmfFtmAuSF4XyX8Cue7OInouw5jz2g17 P94JXU42BYOuefQpvuGP6mrUrBV50+k= Date: Wed, 23 Nov 2022 12:09:08 +0100 From: Borislav Petkov To: Ard Biesheuvel Cc: Tom Lendacky , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , Michael Roth Subject: Re: [PATCH v3 00/17] x86: head_64.S spring cleaning Message-ID: References: <20221122161017.2426828-1-ardb@kernel.org> <5750d157-43dd-6f3d-1407-f41af3cff207@amd.com> <26c34f9e-3b09-7b10-09a2-993a50790447@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 23, 2022 at 11:52:32AM +0100, Ard Biesheuvel wrote: > The patch moves it from .data to .bss inadvertently, and I am not > convinced Tom's analysis is entirely accurate: we may simply have > garbage in image_offset if we access it before .bss gets cleared. That should not be too hard to find out: add an endless loop in asm in the guest right after the first image_offset access: 1: jmp 1b and then dump its value. Or Tom might have an even better solution. But looking at the code, BSS clearing happens later, at .Lrelocated and the EFI stub comes before it. AFAICT. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette