From patchwork Thu Dec 15 12:37:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeniy Baskov X-Patchwork-Id: 635287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BE8CC3DA78 for ; Thu, 15 Dec 2022 12:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiLOMi5 (ORCPT ); Thu, 15 Dec 2022 07:38:57 -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 Precedence: bulk List-ID: X-Mailing-List: linux-efi@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)