Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 Aug 2020 20:48:00 +0200
From: Solar Designer <solar@...nwall.com>
To: lkrg-users@...ts.openwall.com
Cc: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...e.de>,
	Kees Cook <keescook@...omium.org>
Subject: Re: lkrg: Fix build LKRG for kernel 5.8+

On Wed, Aug 05, 2020 at 07:46:48PM +0200, Mikhail Morfikov wrote:
> DKMS make.log for lkrg-0.8.1+git20200805 for kernel 5.8.0-amd64 (x86_64)
[...]
> ERROR: modpost: "native_write_cr4" [/var/lib/dkms/lkrg/0.8.1+git20200805/build/p_lkrg.ko] undefined!

Here's what this is about:

commit 21953ee5013d6632bee90ec89f2df59c69050db0
Author: Thomas Gleixner <tglx@...utronix.de>
Date:   Sun Apr 26 18:55:15 2020 +0200

    x86/cpu: Export native_write_cr4() only when CONFIG_LKTDM=m
    
    Modules have no business poking into this but fixing this is for later.
    
     [ bp: Carve out from an earlier patch. ]
    
    Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
    Signed-off-by: Borislav Petkov <bp@...e.de>
    Link: https://lkml.kernel.org/r/20200421092558.939985695@linutronix.de

where LKTDM is "Linux Kernel Dump Test Module".

We use native_write_cr4() via its wrapper __write_cr4() (in a kernel
header file) to restore SMEP and/or SMAP if these are unexpectedly
disabled yet kernel panic on this event is not enabled in LKRG
configuration (by default it is enabled).

We'll need to find a way around this.  Perhaps will just access the
register directly from our own inline asm.

I am CC'ing this to a few people as a JFYI on what the change actually
achieved.  With 5.8 already released, we'll have to work around this on
our end anyway.

On Wed, Aug 05, 2020 at 07:49:25PM +0200, Mikhail Morfikov wrote:
> At least it builds for 5.7.12 again. :)

I'd be surprised if it did not.

Thank you for testing!

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.