All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Cc: Thorsten Blum <blum@kernel.org>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] x86/realmode: Pad the embedded real-mode blob to a page boundary
Date: Sun,  8 Nov 2026 22:02:15 +0100	[thread overview]
Message-ID: <20261108210215.407893-3-blum@kernel.org> (raw)

setup_real_mode() copies the page-aligned size of the embedded real-mode
blob into low memory. However, real_mode_blob ends immediately before
real_mode_relocs, so the copy includes relocation data and potentially
other .init.data contents when the size of realmode.bin is not
page-aligned.

Pad real_mode_blob to a page boundary so the copy contains only the
real-mode binary and its padding.

Fixes: 084ee1c641a0 ("x86, realmode: Relocator for realmode code")
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/x86/realmode/rmpiggy.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/realmode/rmpiggy.S b/arch/x86/realmode/rmpiggy.S
index c8fef76743f6..ce5350241238 100644
--- a/arch/x86/realmode/rmpiggy.S
+++ b/arch/x86/realmode/rmpiggy.S
@@ -12,6 +12,7 @@
 
 SYM_DATA_START(real_mode_blob)
 	.incbin	"arch/x86/realmode/rm/realmode.bin"
+	.balign PAGE_SIZE
 SYM_DATA_END_LABEL(real_mode_blob, SYM_L_GLOBAL, real_mode_blob_end)
 
 SYM_DATA_START(real_mode_relocs)

                 reply	other threads:[~2026-11-08 21:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261108210215.407893-3-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jarkko.sakkinen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.