From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: robert.richter@amd.com, schwidefsky@de.ibm.com, mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] updates for oprofile
Date: Tue, 27 Apr 2010 18:25:44 +0300 [thread overview]
Message-ID: <20100427152544.GA9063@pcarmody-desktop> (raw)
Ingo, et al.,
Regarding today's pulled request, containing:
commit bc078e4eab65f11bbaeed380593ab8151b30d703
Author: Martin Schwidefsky <schwidef...@de.ibm.com>
Date: Tue Mar 2 16:01:10 2010 +0100
oprofile: convert oprofile from timer_hook to hrtimer
Information is a touch scant, as I'm doing the investigation as I
write, but I believe that that patch can cause ooops regressions
via a null-pointer dereference in oprofile_add_sample().
That function declares:
"""
/**
* Add a sample. This may be called from any context.
*/
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event);
"""
And begins:
"""
void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
{
int is_kernel = !user_mode(regs);
"""
Where on at least two major architectures (Arm, x86), user_mode()
unconditionally dereferences its parameter.
Now oprofile_add_sample() is called from this context:
"""
static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer)
{
oprofile_add_sample(get_irq_regs(), 0);
"""
And get_irq_regs() is NULL when not in an IRQ context.
Bang.
An example of this kind of thing kicking in has already been encountered
last year:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg14069.html
(That thread got a little side-tracked onto OMAP specifics, but the
original report is topical.)
Now would be a very good time for the "many eyes" principle to kick in.
I'm now looking into workarounds, but nothing that I'd necessarily
want to submit as a real fix.
Phil
cc:'d replies appreciated
next reply other threads:[~2010-04-27 15:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 15:25 Phil Carmody [this message]
2010-04-27 17:40 ` [GIT PULL] updates for oprofile Robert Richter
2010-04-27 17:47 ` Siarhei Siamashka
2010-04-28 16:59 ` Robert Richter
2010-04-28 17:09 ` Phil Carmody
2010-04-28 21:14 ` Robert Richter
2010-05-03 21:18 ` Robert Richter
2010-04-28 19:24 ` [PATCH] oprofile, hrtimer: only add samples if regs are available Robert Richter
-- strict thread matches above, loose matches on Subject: below --
2010-05-04 10:44 [PATCH 0/7] updates for oprofile Robert Richter
2010-05-06 13:03 ` [GIT PULL] " Robert Richter
2010-05-06 14:21 ` Ingo Molnar
2010-04-23 15:40 Robert Richter
2010-04-27 9:20 ` Ingo Molnar
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=20100427152544.GA9063@pcarmody-desktop \
--to=ext-phil.2.carmody@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=robert.richter@amd.com \
--cc=schwidefsky@de.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.