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]
Date:   Thu, 6 Aug 2020 18:06:43 +0200
From:   Marco Elver <elver@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        fenghua.yu@...el.com, "H. Peter Anvin" <hpa@...or.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Luck, Tony" <tony.luck@...el.com>,
        "the arch/x86 maintainers" <x86@...nel.org>, yu-cheng.yu@...el.com,
        jgross@...e.com, sdeep@...are.com,
        virtualization@...ts.linux-foundation.org,
        kasan-dev <kasan-dev@...glegroups.com>,
        syzbot <syzbot+8db9e1ecde74e590a657@...kaller.appspotmail.com>
Subject: Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers

On Thu, 6 Aug 2020 at 15:17, Marco Elver <elver@...gle.com> wrote:
>
> On Thu, Aug 06, 2020 at 01:32PM +0200, peterz@...radead.org wrote:
> > On Thu, Aug 06, 2020 at 09:47:23AM +0200, Marco Elver wrote:
> > > Testing my hypothesis that raw then nested non-raw
> > > local_irq_save/restore() breaks IRQ state tracking -- see the reproducer
> > > below. This is at least 1 case I can think of that we're bound to hit.
> ...
> >
> > /me goes ponder things...
> >
> > How's something like this then?
> >
> > ---
> >  include/linux/sched.h |  3 ---
> >  kernel/kcsan/core.c   | 62 ++++++++++++++++++++++++++++++++++++---------------
> >  2 files changed, 44 insertions(+), 21 deletions(-)
>
> Thank you! That approach seems to pass syzbot (also with
> CONFIG_PARAVIRT) and kcsan-test tests.
>
> I had to modify it some, so that report.c's use of the restore logic
> works and not mess up the IRQ trace printed on KCSAN reports (with
> CONFIG_KCSAN_VERBOSE).
>
> I still need to fully convince myself all is well now and we don't end
> up with more fixes. :-) If it passes further testing, I'll send it as a
> real patch (I want to add you as Co-developed-by, but would need your
> Signed-off-by for the code you pasted, I think.)

With CONFIG_PARAVIRT=y (without the notrace->noinstr patch), I still
get lockdep DEBUG_LOCKS_WARN_ON(!lockdep_hardirqs_enabled()), although
it takes longer for syzbot to hit them. But I think that's expected
because we can still get the recursion that I pointed out, and will
need that patch.

I also get some "BUG: MAX_LOCKDEP_CHAINS too low!" on syzbot (KCSAN is
not in the stacktrace). Although it may be unrelated:
https://lore.kernel.org/lkml/0000000000005613c705aaf88e04@google.com/
-- when are they expected?

Thanks,
-- Marco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ