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: <CALCETrVt3S5v_1QNYBQyMW-FZxhyQ3c6u6m=FPWKR7qaPs6q2Q@mail.gmail.com>
Date:   Mon, 5 Feb 2018 16:37:26 +0000
From:   Andy Lutomirski <luto@...capital.net>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Josh Poimboeuf <jpoimboe@...hat.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andi Kleen <ak@...ux.intel.com>, X86 ML <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Andrew Lutomirski <luto@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v2 1/3] x86/entry: Clear extra registers beyond syscall
 arguments for 64bit kernels

On Mon, Feb 5, 2018 at 4:30 PM, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Andy Lutomirski <luto@...capital.net> wrote:
>
>>
>>
>> > On Feb 5, 2018, at 3:42 AM, Ingo Molnar <mingo@...nel.org> wrote:
>> >
>> >
>> > * Dan Williams <dan.j.williams@...el.com> wrote:
>> >
>> >> +    /*
>> >> +     * Sanitize extra registers of values that a speculation attack
>> >> +     * might want to exploit. In the CONFIG_FRAME_POINTER=y case,
>> >> +     * the expectation is that %ebp will be clobbered before it
>> >> +     * could be used.
>> >> +     */
>> >> +    .macro CLEAR_EXTRA_REGS_NOSPEC
>> >> +    xorq %r15, %r15
>> >> +    xorq %r14, %r14
>> >> +    xorq %r13, %r13
>> >> +    xorq %r12, %r12
>> >> +    xorl %ebx, %ebx
>> >> +#ifndef CONFIG_FRAME_POINTER
>> >> +    xorl %ebp, %ebp
>> >> +#endif
>> >> +    .endm
>> >
>> > Yeah, so this series look pretty good to me, but there's one small detail: I think
>> > RBP should be cleared unconditionally here, even in the CONFIG_FRAME_POINTERS=y
>> > case, because:
>>
>> ENCODE_FRAME_POINTER should take care of rbp, though.
>
> AFAICS there's various entry paths where it's not used I think: for example the
> compat system calls in entry_64_compat.S don't seem to encode RBP in such a
> fashion (unless I missed some macro side effect).

Then that's a separate bug that should be fixed.  Josh?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ