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: <CALCETrVd_hT9vDkWAa5omzfVqpSny5KiU34ffM34AuL0JSGRUA@mail.gmail.com>
Date:   Mon, 20 Nov 2017 19:20:32 -0800
From:   Andy Lutomirski <luto@...nel.org>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
        Borislav Petkov <bpetkov@...e.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Brian Gerst <brgerst@...il.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 13/16] x86/entry/64: Create a percpu SYSCALL entry trampoline

On Mon, Nov 20, 2017 at 6:34 PM, Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> On Mon, Nov 20, 2017 at 09:07:44AM -0800, Andy Lutomirski wrote:
>> +     /* Save RDI, since we need a scratch register. */
>> +     pushq   %rdi
>> +
>> +     /*
>> +      * x86 lacks a near absolute jump, and we can't jump to the real
>> +      * entry text with a relative jump, so we use a double trampoline.
>> +      */
>> +     movq    $entry_SYSCALL_64_stage2, %rdi
>> +     jmp     *%rdi
>> +END(entry_SYSCALL_64_trampoline)
>> +
>> +     .popsection
>> +
>> +ENTRY(entry_SYSCALL_64_stage2)
>> +     /*
>> +      * Rather than polluting the normal SYSCALL path with stack switching
>> +      * nonsense, fix up our register state to match its expectations.
>> +      */
>> +     UNWIND_HINT_EMPTY
>> +     popq %rdi
>> +     jmp entry_SYSCALL_64_after_hwframe
>> +END(entry_SYSCALL_64_stage2)
>
> Is there a reason why you couldn't just do the following?
>
>         pushq   $entry_SYSCALL_64_after_hwframe
>         ret
>
> Then you wouldn't need the 2nd trampoline and the %rdi clobber.
>

Good suggestion.  Thanks!

> --
> Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ