Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4167140rwb; Tue, 6 Sep 2022 03:43:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7lZvE1J6idp6tGg0JWXkR+UCK8w4dx46qvQ0oQrFIH8/T2XidtHwhYiw5xjLoBdTvq615P X-Received: by 2002:a17:903:2411:b0:172:ba7e:e54d with SMTP id e17-20020a170903241100b00172ba7ee54dmr54297922plo.165.1662460992011; Tue, 06 Sep 2022 03:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662460992; cv=none; d=google.com; s=arc-20160816; b=vmvYfbuiZ5sLvKqrd/imvQUZCM5vY6bkIyK+JygnLldWPLYLe/7nh2MGIP8Dn6W/kP Ugol3en5OxtxzpeoU+n77tq/VGSWSllxzcPA+VMWllvWWyIooKpJfAgTbVFS/Br6z9Nf fVVRuQVUKthEEM5IShyhNEQKANRsJA4tcqOapTPaSosfsEw4MEwWc0kNbdnwqjH9eMrB sP7lcaySenLGNHyVzvmBUO5mf6BUIWlVrQn0H5Y/OZ/n6mpSRTf5LCLuGN+HYoqclRhF Zzb2CSTtWnJh2qZzybbz4wZuS2BgYQ+xqjN08F5190bT+XV/xUYXbnvwRs0yaXkFb88q 2GvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=I3O2mZJn4qP4xw8qjGj/0tOOp/xlfh8VVD/hsORpLTc=; b=RGTUKtzTo8ctxRSQeVYHygSidCbBYxCoiAtepIEgvetMU7dEEajU31xurXqLlNycgv 7QbwWoEkuKvHsnuDLF5AO23phFnt7u/52gHkPxxchXS4cx1HcN545CEwyhf4kt7oahqs zWW2kS2AzLNEUo17j00VEmIFWss0/FlJOZoXGT/zOQz802hgUb5v/KrUGaSplRw2nC8r 9S5QUSbyEAIZ3VkDXUvsvNdnLe/dijwcrLJlFj+9do6sDHe8nhCAW5qcN5qRbrIrDlrN ARdPxDmDynChxfHsiLHiJgvC8b4WyuK2f8IbcM5ekuaIcvLXb7c4h95Xjq6Md4KDgKL+ diNA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w134-20020a62828c000000b00536f59ec245si1796000pfd.161.2022.09.06.03.42.59; Tue, 06 Sep 2022 03:43:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239551AbiIFKmH (ORCPT + 99 others); Tue, 6 Sep 2022 06:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234083AbiIFKlp (ORCPT ); Tue, 6 Sep 2022 06:41:45 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB5E85F135; Tue, 6 Sep 2022 03:41:43 -0700 (PDT) Received: from localhost.localdomain (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPSA id 352AB407624D; Tue, 6 Sep 2022 10:41:38 +0000 (UTC) From: Evgeniy Baskov To: Ard Biesheuvel Cc: Evgeniy Baskov , Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , lvc-project@linuxtesting.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 01/16] x86/boot: Align vmlinuz sections on page size Date: Tue, 6 Sep 2022 13:41:05 +0300 Message-Id: <27a078f43742063cc30e706b196fb5fff5d5c37e.1662459668.git.baskov@ispras.ru> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 To protect sections on page table level each section needs to be aligned on page size (4KB). Set sections alignment in linker script. Signed-off-by: Evgeniy Baskov --- arch/x86/boot/compressed/vmlinux.lds.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S index 112b2375d021..6be90f1a1198 100644 --- a/arch/x86/boot/compressed/vmlinux.lds.S +++ b/arch/x86/boot/compressed/vmlinux.lds.S @@ -27,21 +27,27 @@ SECTIONS HEAD_TEXT _ehead = . ; } + . = ALIGN(PAGE_SIZE); .rodata..compressed : { + _compressed = .; *(.rodata..compressed) + _ecompressed = .; } + . = ALIGN(PAGE_SIZE); .text : { _text = .; /* Text */ *(.text) *(.text.*) _etext = . ; } + . = ALIGN(PAGE_SIZE); .rodata : { _rodata = . ; *(.rodata) /* read-only data */ *(.rodata.*) _erodata = . ; } + . = ALIGN(PAGE_SIZE); .data : { _data = . ; *(.data) -- 2.35.1