Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp818325iog; Wed, 29 Jun 2022 10:49:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sBjgAgSc7PVFRnACse9ioU3USPJ1PYfQUalebo5WnvB9Os+bp4FrXH3wL7SgKVKWaKu2Zx X-Received: by 2002:a17:902:f543:b0:16a:54c6:78d0 with SMTP id h3-20020a170902f54300b0016a54c678d0mr10215250plf.28.1656524978938; Wed, 29 Jun 2022 10:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656524978; cv=none; d=google.com; s=arc-20160816; b=c8gghwwioYU4YBRNEF9BS635vqeLAw5TH5+Pw6UFmwfYdCmOX+cVfr2Ripqljvh+ge SZ+21kfdXMnH6oxtOpXItJsHSNwnvAblFzqUg34eqxyRLSLjAkETHyN0Ofl/fjp7GRXc BPWHvgu2QCuVPFqSFt4V9RIOSOz1TaiQf9fkcDV6j3YqUp7KV1txzfpJi3Gccg0PamHw f+62PEEiP9kZ8xmhcpjk/Sj6/V9kecrXZsEh0DRbq1azD8FjK9/XoCAYYqZ4huA+GgwL uUiUn7Qmc3Q2aMkPpFryI56LpELcKyBtGP+71Gpp7tDc2FJBRqWGBFhwSk0bp1n/9d+J COPg== 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=otVxRcv+kR9hG+dqRtQWeDWa1co+B7myAktlS/uCZOA=; b=EBMawtGjyiaKeEDWUGwkad8vntPOzWmPrFzuYKw07+MeOd4OVflCq4UR4fECDjKYR1 EruoLU0vsZnmM8Fda+5bP9GGBJXSsyc4w6aVSoscjtaAPPu22QiXA9ypYlIijh4OD1bX gUY2HTufd4jgvSYqTbvVDJJ4TCQ19su9lh7LCC1gNADdvjt8I0lCT92Bqw4MwJNkVoyR i64NYeveB5SfhwIfR//Hmj2tdU2kYDCYqFnv9IAWFaJRE/zxn7boSI7ziJQdHnj8Jf0i bnqRVoEHN7IQOMNbj/MR/b4f8OSfQdui7paQXZLv7BRB2mQGGCEZA/0Gd5yWR2iaq0qE 5WAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ti985LV+; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902d49100b00162ba3ef425si30479535plg.439.2022.06.29.10.49.26; Wed, 29 Jun 2022 10:49:38 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=ti985LV+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbiF2RSd (ORCPT + 99 others); Wed, 29 Jun 2022 13:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiF2RSc (ORCPT ); Wed, 29 Jun 2022 13:18:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B941A812 for ; Wed, 29 Jun 2022 10:18:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D444461E56 for ; Wed, 29 Jun 2022 17:18:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2C95C34114; Wed, 29 Jun 2022 17:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656523111; bh=cElJT+fqYXMLdJ0O9skHbTQ8acmcYY3npP0Idut/ntE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ti985LV+4onMHrTrVh1q2DMliiCN0ww7NfP/MJct+nuqmClkkjSIm86ULTpKL6g59 j52/wek/dOmKMWSktBjEyg1c3kKfFSnPTazCVlvOWhTqyvfGgp3YWMqiwQVEherWIx 3rqDa3Vl8HJobmeSU2QbQa1aLy6JIFBt1L9QOc+Hg4uEotfZ7mm8fA+CgaOVzQtRju ltcPDaOpAuvwEcnqabUllBaMIDjNmYW9vzyVao4gVbX8MBdN0LZKtvwywxC/uRQ7af pWZwK075jfREZIJpdmS6LNLO0ojr7i5JUu0L0Ncws5c/OqsGKW84vkr92vx8zhwQOE vyBGKuZ/nMtIw== Date: Wed, 29 Jun 2022 10:18:29 -0700 From: Josh Poimboeuf To: Juergen Gross Cc: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH v2 3/3] x86: fix .brk attribute in linker script Message-ID: <20220629171829.shotpln44nzgo2eu@treble> References: <20220623094608.7294-1-jgross@suse.com> <20220623094608.7294-4-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220623094608.7294-4-jgross@suse.com> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, Jun 23, 2022 at 11:46:08AM +0200, Juergen Gross wrote: > Commit e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils") > added the "NOLOAD" attribute to the .brk section as a "failsafe" > measure. > > Unfortunately this leads to the linker no longer covering the .brk > section in a program header, resulting in the kernel loader not knowing > that the memory for the .brk section must be reserved. > > This has led to crashes when loading the kernel as PV dom0 under Xen, > but other scenarios could be hit by the same problem (e.g. in case an > uncompressed kernel is used and the initrd is placed directly behind > it). > > So drop the "NOLOAD" attribute. This has been verified to correctly > cover the .brk section by a program header of the resulting ELF file. > > Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils") > Signed-off-by: Juergen Gross Reviewed-by: Josh Poimboeuf -- Josh