Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp947602rwb; Thu, 15 Dec 2022 04:44:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Ia2r5kFscMkGwDK3Uu7yXSjCiNndZ1f61137VvDvv/tsYfY+AMP+D5yckC2f8LEQ+1bFJ X-Received: by 2002:a17:906:4e8e:b0:7c1:458b:a946 with SMTP id v14-20020a1709064e8e00b007c1458ba946mr20025864eju.0.1671108246120; Thu, 15 Dec 2022 04:44:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671108246; cv=none; d=google.com; s=arc-20160816; b=fHBcwLtZSrp2r1lV/PPg1T8myp83Bc/gsscLrv0lqc3yLbul4eimXgNME9acexbCUk H2GPW8gHq2DLatg3rd6NKr0Et8ExwmztL+Uwek1FPeJtVyCS2+ml0zHaW8PZxXiSqyEC jDHcqO5IL1sGaOcpqvUJmfUFgBdqtabBr3oNh1RAGm94g+5gLX3GBof3Vc6vQK0fY4Qu ciTCCjVukvPeSx7ktaaAgD43+9OnDvc5ndd7juk/MGZln7fvObz4/LOWNz1ZyjsyQ49z Wh0XI72ceX76GuvrogfTNs1s32gLgrb0OU291n7gFJ46UVmIHyEGzVu2Wt3BdgajH6d7 2zXw== 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 :dkim-signature:dkim-filter; bh=HCT9Bqc8AfDy32Gy69bG6cmksbJB19vhwIjrpscg4oM=; b=D8FQ927/UMnxfWX+MBEZVhcUypxQ5vSKUkxrV7Vex0cPvzbUAikeAMYas98VLH0o9a gWUPMdNYKZKuBIKGviQJmsiiGGKe3vERcT9itgHWiQQgi2tgkAVNr7NpDozEZ96WFd69 AKQasVvNFgpXe6ZJWkyAfYan4+ZRMSvaxWzrjNgpehHBRH45rgjqauLAXYZnfa0nH23K 1pdCdgESirjzq2kWz76eAt5eOOMsu96aJ1VDRxt1tGsxYbi/tf3UFEcRSZUz/nagJGZR IFDoaZ0DvBQbvAs/cSEP3JuF8H1FGkPV4FeYvi78avQl1zfTCu9JSNtOeZ8ssitqpdBu 4eBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=Me3K4RFI; 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=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc13-20020a170906dfed00b007c146656542si11520875ejc.304.2022.12.15.04.43.49; Thu, 15 Dec 2022 04:44:06 -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=@ispras.ru header.s=default header.b=Me3K4RFI; 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=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbiLOMjA (ORCPT + 68 others); Thu, 15 Dec 2022 07:39:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiLOMii (ORCPT ); Thu, 15 Dec 2022 07:38:38 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85EB12EF61; Thu, 15 Dec 2022 04:38:25 -0800 (PST) Received: from localhost.localdomain (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPSA id 7A286419E9FF; Thu, 15 Dec 2022 12:38:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 7A286419E9FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1671107901; bh=HCT9Bqc8AfDy32Gy69bG6cmksbJB19vhwIjrpscg4oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Me3K4RFI3zOA+GEY6O/L53J/ZrEO+4P8JYlfVVmXXeNKMCC2nO5F7oaz8/MYBxNGG lFKG/klJA8o6F/rS9L36xr7uqv2cEdd/7oSnSryOLpV3KICuw61yK8utNQkWMIWvc3 gzxB2OYv8tSToGikokKrEKkxcc70QOS05hjM9il8= From: Evgeniy Baskov To: Ard Biesheuvel Cc: Evgeniy Baskov , Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , Peter Jones , "Limonciello, Mario" , joeyli , lvc-project@linuxtesting.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v4 01/26] x86/boot: Align vmlinuz sections on page size Date: Thu, 15 Dec 2022 15:37:52 +0300 Message-Id: <8211c633eb5dceeabee2996a4db91cd971cf7c77.1671098103.git.baskov@ispras.ru> X-Mailer: git-send-email 2.37.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 To protect sections on page table level each section needs to be aligned on page size (4KB). Set sections alignment in linker script. Tested-by: Mario Limonciello Tested-by: Peter Jones 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.37.4