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:   Thu, 28 Feb 2019 19:01:49 +0300
From:   Andrey Ryabinin <>
To:     Peter Zijlstra <>
Cc:     Dmitry Vyukov <>,
        Linus Torvalds <>,
        Thomas Gleixner <>,
        "H. Peter Anvin" <>,
        Julien Thierry <>,
        Will Deacon <>,
        Andy Lutomirski <>,
        Ingo Molnar <>,
        Catalin Marinas <>,
        James Morse <>,,
        Brian Gerst <>,
        Josh Poimboeuf <>,
        Andy Lutomirski <>,
        Borislav Petkov <>,
        Denys Vlasenko <>,
        LKML <>
Subject: Re: [PATCH 1/8] kasan,x86: Frob kasan_report() in an exception

On 2/28/19 6:52 PM, Dmitry Vyukov wrote:
> On Thu, Feb 28, 2019 at 4:46 PM Peter Zijlstra <> wrote:
>> On Thu, Feb 28, 2019 at 04:22:04PM +0100, Dmitry Vyukov wrote:
>>> On Thu, Feb 28, 2019 at 4:05 PM Peter Zijlstra <> wrote:
>>>> Because __asan_{load,store}{N,1,2,4,8,16}_noabort() get called from
>>>> UACCESS context, and kasan_report() is most definitely _NOT_ safe to
>>>> be called from there, move it into an exception much like BUG/WARN.
>>>> *compile tested only*
>>> Please test it by booting KASAN kernel and then loading module
>>> produced by CONFIG_TEST_KASAN=y. There are too many subtle aspects to
>>> rely on "compile tested only", reviewers can't catch all of them
>>> either.
>> Sure, I'll do that. I just wanted to share the rest of the patches.
>> A quick test shows it dies _REAAAAAAAALY_ early, as in:
>> "Booting the kernel."
>> is the first and very last thing it says... I wonder how I did that :-)
> One thing is that during early boot kasan_report is called multiple
> times, but these are false positives related to the fact that we don't
> have a proper shadow yet (setup later). So during early boot we set
> kasan_disable=1 (or some global or per-task flag), and then
> kasan_report checks it and returns.
> Once we setup proper shadow, the flag is reset and from now on
> kasan_report actually reports bug.

Yup, see report_enabled() function.

Powered by blists - more mailing lists