From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 1/6] Linux Kernel Markers - Architecture Independent Code
Date: Fri, 7 Sep 2007 09:01:42 -0400 [thread overview]
Message-ID: <20070907130142.GD9735@Krystal> (raw)
In-Reply-To: <20070906160001.cfe48d78.randy.dunlap@oracle.com>
* Randy Dunlap (randy.dunlap@oracle.com) wrote:
[snip]
>
> > +/*
> > + * Sets the probe callback corresponding to one marker.
> > + */
> > +static int set_marker(struct marker_entry **entry,
> > + struct __mark_marker *elem)
> > +{
> > + int ret;
> > + BUG_ON(strcmp((*entry)->name, elem->name) != 0);
>
> You can't return -ENOENT here?
>
I could, but it's really a bug: if this condition happens, there would
be an inconsistency in the hash table get_marker() function. Therefore I
prefer to yell if this happens rather than simply telling the caller
that the entry does not exist.
And actually, marker_update_probe_range ignores errors from set_marker
(there is even a comment saying that in the code) :
if (mark_entry && mark_entry->refcount) {
set_marker(&mark_entry, iter);
/*
* ignore error, continue
*/
It is done on purpose: if a marker does not have the right arguments, it
will simply be skipped and a printk warning will be emitted. I prefer
this approach rather than stopping marker activation/disactivation as
soon as a bad marker is found.
[...]
> > +#ifdef CONFIG_MODULES
> > +/*
> > + * Update module probes.
> > + * Must be called with markers_mutex held.
> > + */
> > +static inline void marker_update_probes_modules(struct module *probe_module,
> > + int *refcount)
> > +{
> > + struct module *mod;
> > +
> > + list_for_each_entry(mod, &modules, list) {
> > + if (!mod->taints) {
> > + marker_update_probe_range(mod->markers,
> > + mod->markers+mod->num_markers,
> > + probe_module, refcount);
> > + }
> > + }
> > +}
>
> hm, so if the module is tainted, markers won't be applied to it?
> That's OK IMO.
Yep,
> However, I tend to think that something that
> modifies code on the fly (like kprobes or text edit) should set some
> flag somewhere so that when the system crashes, we can know that
> code was modified. This could be done via taints flags or some other
> mechanism. Has this already been discussed?
>
I am not aware of discussions about this. But then we would have to do
the same for paravirt, alternatives, kprobes and immediate values.
As soon as the kernel code of a crashing kernel may have been modified
in memory, the image of the crashed kernel should be used instead of the
compiled image to analyze the crash. But code patching becomes so common
that we will have to start using core dumps more and more.
Yes, your idea makes sense. printking that kind of information in a OOPS
would be useful IMO.
Mathieu
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2007-09-07 13:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-06 20:07 [patch 0/6] Linux Kernel Markers for 2.6.23-rc4-mm1 Mathieu Desnoyers
2007-09-06 20:07 ` [patch 1/6] Linux Kernel Markers - Architecture Independent Code Mathieu Desnoyers
2007-09-06 23:00 ` Randy Dunlap
2007-09-06 23:04 ` Andrew Morton
2007-09-06 23:37 ` Randy Dunlap
2007-09-07 4:05 ` Valdis.Kletnieks
2007-09-07 4:11 ` Randy Dunlap
2007-09-07 16:04 ` Theodore Tso
2007-09-07 17:10 ` Valdis.Kletnieks
2007-09-07 19:31 ` Christoph Hellwig
2007-09-07 21:30 ` Roland Dreier
2007-09-07 13:01 ` Mathieu Desnoyers [this message]
2007-09-06 20:07 ` [patch 2/6] Linux Kernel Markers - Add kconfig menus for the marker code Mathieu Desnoyers
2007-09-06 23:35 ` Randy Dunlap
2007-09-12 14:54 ` Mathieu Desnoyers
2007-09-06 20:07 ` [patch 3/6] Linux Kernel Markers - Documentation Mathieu Desnoyers
2007-09-06 23:48 ` Randy Dunlap
2007-09-06 20:07 ` [patch 4/6] Linux Kernel Markers - Documentation Fix Mathieu Desnoyers
2007-09-06 20:07 ` [patch 5/6] Port of blktrace to the Linux Kernel Markers Mathieu Desnoyers
2007-09-06 20:07 ` [patch 6/6] Linux Kernel Markers - Port SPU to markers Mathieu Desnoyers
2007-09-08 7:04 ` Alexey Dobriyan
2007-09-08 7:23 ` Mathieu Desnoyers
2007-09-08 12:11 ` Christoph Hellwig
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=20070907130142.GD9735@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox