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  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]
Date:   Wed, 29 Nov 2017 12:48:39 -0800
From:   Linus Torvalds <>
To:     David Laight <>
Cc:     Andy Lutomirski <>,
        Peter Zijlstra <>,
        Ingo Molnar <>,
        Jarkko Nikula <>,
        linux-kernel <>,
        Thomas Gleixner <>,
        Borislav Petkov <>
Subject: Re: [PATCH] x86/entry/64: Fix native_load_gs_index() SWAPGS handling
 with IRQ state tracing enabled

On Wed, Nov 29, 2017 at 8:51 AM, David Laight <> wrote:
> SWAPGS is a PITA. The hardware designers should have tried to write
> all the interrupt handling code.

That's actually my biggest beef with x86-64. The kernel entry/exit is
completely misdesigned.

That was actually better in the original i386, which handles nesting
ok (modulo the NMI disable flag and the STI shadow bit which doesn't
save/restore properly).

Yes, the 386 model of infinite indirection through IDT/GDT/TSS is
broken and should have had a mode bit to just replace with a simple
"use this stack and address for kernel entry" MSR register - but that
simplified kernel entry/exit should have saved/restored _more_ info,
not less (eg "save/restore segment shadow state rather than the
descriptor number that needs the insane indirection" etc)

The problem was never the few push/pop instructions that kernel entry involved.

The entry/exit garbage admittedly started before x86-64 itself - all
those 'syscall' variants are equally broken. Not saving/restoring
state properly is just unbelievable sh*t. x86-64 then made things
worse with SWAPGS etc.

A lot of people hate x86 because of instruction decoding. No, if you
need a reason to dislike x86, it's because of exception handling and

Rant over.


Powered by blists - more mailing lists