lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMzpN2iJ8QFuDq+Sov81X103x7q_-ueoO-nJwEjnF3GpKf2W0g@mail.gmail.com>
Date: Fri, 9 Jan 2026 06:46:02 -0500
From: Brian Gerst <brgerst@...il.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>, 
	Josh Poimboeuf <jpoimboe@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Kees Cook <kees@...nel.org>, 
	Uros Bizjak <ubizjak@...il.com>, linux-hardening@...r.kernel.org
Subject: Re: [RFC/RFT PATCH 15/19] x64/acpi: Use PIC-compatible references in wakeup_64.S

On Fri, Jan 9, 2026 at 2:59 AM Ard Biesheuvel <ardb@...nel.org> wrote:
>
> On Fri, 9 Jan 2026 at 06:01, Brian Gerst <brgerst@...il.com> wrote:
> >
> > On Thu, Jan 8, 2026 at 4:28 AM Ard Biesheuvel <ardb@...nel.org> wrote:
> > >
> > > Use ordinary RIP-relative references to make the code compatible with
> > > running the linker in PIE mode.
> > >
> > > Note that wakeup_long64() runs in the kernel's ordinary virtual mapping
> > > so there is no need to record the address of .Lresume_point in a global
> > > variable. And fix the comment while at it.
> > >
> > > Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> > > ---
> > >  arch/x86/kernel/acpi/wakeup_64.S | 11 ++++-------
> > >  1 file changed, 4 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
> > > index 04f561f75e99..15233a4e1c95 100644
> > > --- a/arch/x86/kernel/acpi/wakeup_64.S
> > > +++ b/arch/x86/kernel/acpi/wakeup_64.S
> > > @@ -14,7 +14,7 @@
> > >
> > >  .code64
> > >         /*
> > > -        * Hooray, we are in Long 64-bit mode (but still running in low memory)
> > > +        * Hooray, we are in Long 64-bit mode
> > >          */
> > >  SYM_FUNC_START(wakeup_long64)
> > >         ANNOTATE_NOENDBR
> > > @@ -41,7 +41,7 @@ SYM_FUNC_START(wakeup_long64)
> > >         movq    saved_rsi(%rip), %rsi
> > >         movq    saved_rbp(%rip), %rbp
> > >
> > > -       movq    saved_rip(%rip), %rax
> > > +       leaq    .Lresume_point(%rip), %rax
> > >         ANNOTATE_RETPOLINE_SAFE
> > >         jmp     *%rax
> >
> > If this is already running on the virtual mapping, this can simply be
> > changed to a direct jump.
> >
>
> Indeed, but I couldn't figure out how to do so without making objtool unhappy.

I replaced it with a simple "jmp .Lresume_point" and objtool seemed
fine with it on a defconfig build.  What error did you see?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ