public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: "Sylvain GENEVES" <Sylvain.Geneves@inrialpes.fr>
Cc: "oprofile-list@lists.sf.net" <oprofile-list@lists.sf.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Oprofile bug ?
Date: Fri, 12 Nov 2010 16:45:14 -0500	[thread overview]
Message-ID: <y0mlj4yw711.fsf@fche.csb> (raw)
In-Reply-To: <c69374315a434a8bab96c55e4542bc81.squirrel@webmail.inrialpes.fr> (Sylvain GENEVES's message of "Fri, 12 Nov 2010 22:11:05 +0100")

"Sylvain GENEVES" <Sylvain.Geneves@inrialpes.fr> writes:

> [...]
> I'm encountering unexpected behaviour with OProfile when the profiled
> system is under heavy load : "BUG: unable to handle kernel paging request
> at 0000000000004cc3" (full console message is attached).
> [...]
> Anyone has any idea on what is happening ?

Just glancing at that oops & my local random kernel build, it appears
as though this part of arch/x86/kernel/time.c:profile_pc is failing:

unsigned long profile_pc(struct pt_regs *regs)
{
        unsigned long pc = instruction_pointer(regs);

        if (!user_mode_vm(regs) && in_lock_functions(pc)) {
#ifdef CONFIG_FRAME_POINTER
                return *(unsigned long *)(regs->bp + sizeof(long));
#else
                       ^^^^^^^^^^^^^^^^^^
[...]

regs->bp must have been 0x4cbb, which this code turns into an
unchecked dereferences at 0x4cbb+8 = 0x4cc3.  I don't have a theory
as to why regs->bp should have that value in it, but the kernel
should probably use probe_kernel_read() or somesuch to validate the
value before dereferencing it.

- FChE

  reply	other threads:[~2010-11-12 21:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 21:11 Oprofile bug ? Sylvain GENEVES
2010-11-12 21:45 ` Frank Ch. Eigler [this message]
2010-11-13 16:18 ` Peter Zijlstra

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=y0mlj4yw711.fsf@fche.csb \
    --to=fche@redhat.com \
    --cc=Sylvain.Geneves@inrialpes.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sf.net \
    /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