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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 97701C2BA16 for ; Wed, 8 Apr 2020 07:49:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66618206C0 for ; Wed, 8 Apr 2020 07:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586332169; bh=LFSPRKgmR8auwK03bWcZlzXa6g+J6cxGqFZeIyDLWBs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=MhyJfM1/838wkVYqVLqzc+lAQBLOcxZA2GyIk7z0f3rp3gGIhTgA3+hgyM5w6PK7o ccrUSSEk2vx3D8Jy5yceEzH6c2rdEtBLCzNjJMqxdE0ZOeQ/8//zl2+JMCo2vf7ez2 iZOk9t6HfLFICcm40W1J9N8r8oha0OmgCwPR3LXE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgDHHt2 (ORCPT ); Wed, 8 Apr 2020 03:49:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:55722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgDHHt1 (ORCPT ); Wed, 8 Apr 2020 03:49:27 -0400 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 300B720857; Wed, 8 Apr 2020 07:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586332167; bh=LFSPRKgmR8auwK03bWcZlzXa6g+J6cxGqFZeIyDLWBs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=M4A3XfdLzGoCqjFphZs46oHKHPvNRNyaxBpA9xZOfsoCACHV49gh3cMPEQj0HjuuH K5KQp0P7ZX1Za5RsThorpN36rb8kGaUgiaq32dYWGNm/PIEGD7Xe4ymWpTMGYbdsuu gSRBrZ2r52eMPpBPRm9gCBQCDV5PL1qvhKb/3sxc= Received: by mail-io1-f54.google.com with SMTP id b12so6153064ion.8; Wed, 08 Apr 2020 00:49:27 -0700 (PDT) X-Gm-Message-State: AGi0PuZtXrHE6BJHRoT5TAyDCbab9LHXjcCi6fR3Oyja3IP1Pcug2yr4 jZpkLKZnZ/b6PHrWjviDRaWZR8QSdflqXaKQBb4= X-Google-Smtp-Source: APiQypJAwEiSBhRkO0KExJ3QXtqZu8DVb4U6xjsYMWHvwGiy5FHwkV4VytajI+cifcoP5E+rtFqkmv24wXCBpeMiAEI= X-Received: by 2002:a6b:f413:: with SMTP id i19mr5867611iog.203.1586332166519; Wed, 08 Apr 2020 00:49:26 -0700 (PDT) MIME-Version: 1.0 References: <20200406180614.429454-1-nivedita@alum.mit.edu> <20200408074334.GA21886@dhcp-128-65.nay.redhat.com> In-Reply-To: <20200408074334.GA21886@dhcp-128-65.nay.redhat.com> From: Ard Biesheuvel Date: Wed, 8 Apr 2020 09:49:15 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] efi/x86: Move efi stub globals from .bss to .data To: Dave Young , pjones@redhat.com, daniel.kiper@oracle.com, Leif Lindholm Cc: Arvind Sankar , Borislav Petkov , Sergey Shatunov , hpa@zytor.com, Linux Kernel Mailing List , mingo@redhat.com, Thomas Gleixner , x86@kernel.org, linux-efi , initramfs@vger.kernel.org, Donovan Tremura , Harald Hoyer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (add Peter, Leif and Daniel) On Wed, 8 Apr 2020 at 09:43, Dave Young wrote: > > On 04/06/20 at 02:06pm, Arvind Sankar wrote: > > Commit > > > > 3ee372ccce4d ("x86/boot/compressed/64: Remove .bss/.pgtable from > > bzImage") > > > > removed the .bss section from the bzImage. > > > > However, while a PE loader is required to zero-initialize the .bss > > section before calling the PE entry point, the EFI handover protocol > > does not currently document any requirement that .bss be initialized by > > the bootloader prior to calling the handover entry. > > > > When systemd-boot is used to boot a unified kernel image [1], the image > > is constructed by embedding the bzImage as a .linux section in a PE > > executable that contains a small stub loader from systemd together with > > additional sections and potentially an initrd. As the .bss section > > within the bzImage is no longer explicitly present as part of the file, > > it is not initialized before calling the EFI handover entry. > > Furthermore, as the size of the embedded .linux section is only the size > > of the bzImage file itself, the .bss section's memory may not even have > > been allocated. > > I did not follow up the old report, maybe I missed something. But not > sure why only systemd-boot is mentioned here. I also have similar issue > with early efi failure. With these two patches applied, it works well > then. > > BTW, I use Fedora 31 + Grub2 > OK, so I take it this means that GRUB's PE/COFF loader does not zero-initialize BSS either? Does it honor the image size in memory if it exceeds the file size?