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  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:   Fri, 3 Nov 2017 14:07:11 +0300
From:   "Kirill A. Shutemov" <>
To:     Dave Hansen <>
Cc:     Ingo Molnar <>,,, Andy Lutomirski <>,
        Linus Torvalds <>,
        Thomas Gleixner <>,
        Peter Zijlstra <>,
        "H. Peter Anvin" <>,
        borisBrian Gerst <>,
        Denys Vlasenko <>,
        Josh Poimboeuf <>,
        Thomas Garnier <>,
        Kees Cook <>
Subject: Re: [PATCH 00/23] KAISER: unmap most of the kernel from userspace
 page tables

On Wed, Nov 01, 2017 at 03:14:11PM -0700, Dave Hansen wrote:
> On 11/01/2017 01:54 AM, Ingo Molnar wrote:
> > Beyond the inevitable cavalcade of (solvable) problems that will pop up during 
> > review, one major item I'd like to see addressed is runtime configurability: it 
> > should be possible to switch between a CR3-flushing and a regular syscall and page 
> > table model on the admin level, without restarting the kernel and apps. Distros 
> > really, really don't want to double the number of kernel variants they have.
> > 
> > The 'Kaiser off' runtime switch doesn't have to be as efficient as 
> > CONFIG_KAISER=n, at least initialloy, but at minimum it should avoid the most 
> > expensive page table switching paths in the syscall entry codepaths.
> Due to popular demand, I went and implemented this today.  It's not the
> prettiest code I ever wrote, but it's pretty small.
> Just in case anyone wants to play with it, I threw a snapshot of it up here:
> >
> I ran some quick tests.  When CONFIG_KAISER=y, but "echo 0 >
> kaiser-enabled", the tests that I ran were within the noise vs. a
> vanilla kernel, and that's with *zero* optimization.

It doesn't compile with KASLR enabled :P


diff --git a/arch/x86/boot/compressed/pagetable.c b/arch/x86/boot/compressed/pagetable.c
index f1aa43854bed..7be5fdd77a3f 100644
--- a/arch/x86/boot/compressed/pagetable.c
+++ b/arch/x86/boot/compressed/pagetable.c
@@ -35,6 +35,10 @@
 /* Used by pgtable.h asm code to force instruction serialization. */
 unsigned long __force_order;
+int kaiser_enabled = 1;
 /* Used to track our page table allocation area. */
 struct alloc_pgt_data {
 	unsigned char *pgt_buf;
 Kirill A. Shutemov

Powered by blists - more mailing lists