From nobody Sun Apr 12 04:22:52 2026 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 931D0C00144 for ; Mon, 1 Aug 2022 16:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233350AbiHAQjP (ORCPT ); Mon, 1 Aug 2022 12:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232571AbiHAQjK (ORCPT ); Mon, 1 Aug 2022 12:39:10 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68BCC30C for ; Mon, 1 Aug 2022 09:39:09 -0700 (PDT) Received: from localhost.localdomain (unknown [92.49.173.143]) by mail.ispras.ru (Postfix) with ESMTPSA id 73EC1407625D; Mon, 1 Aug 2022 16:39:07 +0000 (UTC) From: Evgeniy Baskov To: Borislav Petkov Cc: Evgeniy Baskov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov Subject: [PATCH 1/8] x86/boot: Align vmlinuz sections on page size Date: Mon, 1 Aug 2022 19:38:58 +0300 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compres= sed/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 =3D . ; } + . =3D ALIGN(PAGE_SIZE); .rodata..compressed : { + _compressed =3D .; *(.rodata..compressed) + _ecompressed =3D .; } + . =3D ALIGN(PAGE_SIZE); .text : { _text =3D .; /* Text */ *(.text) *(.text.*) _etext =3D . ; } + . =3D ALIGN(PAGE_SIZE); .rodata : { _rodata =3D . ; *(.rodata) /* read-only data */ *(.rodata.*) _erodata =3D . ; } + . =3D ALIGN(PAGE_SIZE); .data : { _data =3D . ; *(.data) --=20 2.35.1