mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: perf: fuzzer triggers NULL pointer derefreence in x86_schedule_events
Date: Thu, 7 May 2015 14:43:00 +0200	[thread overview]
Message-ID: <20150507124300.GK23123@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CABPqkBRiAe3HmYN7vACH-8OPMOLXKrETY_8n0Hm3pyVcuLHfug@mail.gmail.com>

On Mon, May 04, 2015 at 12:32:56PM -0700, Stephane Eranian wrote:
> On Fri, May 1, 2015 at 5:59 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Thu, Apr 30, 2015 at 03:08:56PM -0400, Vince Weaver wrote:
> > >
> > > So the perf_fuzzer caught this after about a week of fuzzing on a Haswell
> > > machine running a recent git kernel (pre 4.1-rc1 though).
> > >
> > > We've seen this BUG before and various fixes were applied but apparently
> > > it wasn't enough.
> > >
> > > Sadly it doesn't seem to be reproducible.
> > >
> > > validate_group() -> x86_pmu.schedule_events() -> ???? -> variable_test_bit()
> > >  (hard to tell which test bit with all the inlining going on).
> >
> > Assuming you build with debug info addr2line -i can help, but I think I
> > found it by comparing the Code section below with my objdump -D output.
> >
> > Its:
> >                 /* constraint still honored */
> >                 if (!test_bit(hwc->idx, c->idxmsk))
> >                         break;
> >
> > Which would seem to suggest c is NULL.
> >
> But then, you'd crash in the previous loop, because after
> get_event_contraint(), you touch
> c->weight.

Indeed so; and we can make an analogous argument for hwc. However:

> I think it is more likely related to the bitmask (idxmsk).  But then
> it is always allocated with the constraint even with the HT bug
> workaround.  So most, likely the index is bogus and you touch outside
> the idxmsk[] array.

[428232.701319] BUG: unable to handle kernel NULL pointer dereference at           (null)

But the thing really tried to touch NULL, not some random address that
faulted.

As always, Vince has found us a good puzzle ;-)

  reply	other threads:[~2015-05-07 12:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 19:08 Vince Weaver
2015-05-01 12:59 ` Peter Zijlstra
2015-05-04 19:32   ` Stephane Eranian
2015-05-07 12:43     ` Peter Zijlstra [this message]
2015-05-08  4:25       ` Vince Weaver
2015-05-18 17:40       ` Vince Weaver
2015-05-20 13:03         ` Peter Zijlstra
2015-05-20 13:15           ` Peter Zijlstra
2015-05-20 13:49           ` Peter Zijlstra
2015-05-20 15:26             ` Peter Zijlstra
2015-05-20 16:09               ` Peter Zijlstra
2015-05-24 19:14 ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150507124300.GK23123@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=vincent.weaver@maine.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®