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: <CALCETrVRF34yFtujk+gOUiiPG53bNu+WQH9MgvOa6pdUejb+Kw@mail.gmail.com>
Date:	Thu, 18 Jun 2015 04:06:22 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Rik van Riel <riel@...hat.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Denys Vlasenko <vda.linux@...glemail.com>,
	Borislav Petkov <bp@...en8.de>,
	Kees Cook <keescook@...omium.org>,
	Brian Gerst <brgerst@...il.com>
Subject: Re: [RFC/INCOMPLETE 00/13] x86: Rewrite exit-to-userspace code

On Thu, Jun 18, 2015 at 3:11 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Andy Lutomirski <luto@...capital.net> wrote:
>
>> > The only low level bits remaining in assembly will be low level hardware ABI
>> > details: saving registers and restoring registers to the expected format - no
>> > 'active' code whatsoever.
>>
>> I think this is true for syscalls.  Getting the weird special cases (IRET and GS
>> fault) for error_entry to work correctly in C could be tricky.
>
> Correct, and I double checked the IRET fault path yesterday (fixup_bad_iret), and
> it looks like a straightforward exception handler with limited control flow. It
> can stay in asm just fine, it seems mostly orthogonal to the rest.
>
> I didn't check the GS fault path, but that only affects 32-bit, as we use SWAPGS
> on 64-bit, right? In any case, that code too (32-bit RESTORE_REGS) belongs into
> the natural 'hardware ABI preparation code' that should stay in assembly. (Unless
> I missed some other code that might cause trouble.)

Look for "gs_change".  To change the gs selector, we do swapgs, then
load gs, then swapgs again.  If the gs load fails, then we trigger a
special fixup.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ