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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Jul 2019 17:34:07 +0200
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Borislav Petkov <bp@...e.de>,
        syzbot+370a6b0f11867bf13515@...kaller.appspotmail.com,
        Jiri Olsa <jolsa@...hat.com>, Ingo Molnar <mingo@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH 0/2] perf/hw_breakpoint: Fix breakpoint overcommit issue

On Wed, Jul 10, 2019 at 04:04:21PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 09, 2019 at 03:48:19PM +0200, Frederic Weisbecker wrote:
> > 
> > Syzbot has found a breakpoint overcommit issue:
> > 
> > https://lore.kernel.org/lkml/000000000000639f6a0584d11b82@google.com/
> > 
> > It took me a long time to find out what the actual root problem was. Also
> > its reproducer only worked on a few month old kernel but it didn't feel like
> > the issue was actually solved.
> > 
> > I eventually cooked a reproducer that works with latest upstream, see in
> > the end of this message.
> > 
> > The fix is just a few liner but implies to shut down the context swapping
> > optimization for contexts containing breakpoints.
> > 
> > Also I feel like uprobes may be concerned as well as it seems to make use
> > of event.hw->target after pmu::init().
> 
> Can't we simply swizzle event.hw->target along too?

You mean remove it? But it's still needed by breakpoint code during all the event
lifecycle (init, destroy and anytime in-between).

I wish we could use event->ctx->task instead but on pmu::init() there is no ctx yet (we could pass
the task in parameter though) and on event->destroy() it's TASK_TOMBSTONE and retrieving the task
at that time would be non trivial.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ