summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--tapsets.cxx11
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ab7d2ab..9dc52c8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-02 Frank Ch. Eigler <fche@redhat.com>
+
+ PR 3261.
+ * tapsets.cxx (query_module): Reject elfutils module "kernel"
+ unless kernel.* probe point used.
+
2007-04-02 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (query_dwarf_func): Skip non-inlined functions
diff --git a/tapsets.cxx b/tapsets.cxx
index ba2ffd87..8eeab131 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1954,7 +1954,8 @@ struct dwarf_query
Dwarf_Addr addr);
// Extracted parameters.
- string module_val;
+ bool has_kernel;
+ string module_val; // has_kernel => module_val = "kernel"
string function_val;
bool has_function_str;
@@ -2084,7 +2085,7 @@ dwarf_query::dwarf_query(systemtap_session & sess,
// Reduce the query to more reasonable semantic values (booleans,
// extracted strings, numbers, etc).
- bool has_kernel = has_null_param(params, TOK_KERNEL);
+ has_kernel = has_null_param(params, TOK_KERNEL);
if (has_kernel)
module_val = "kernel";
else
@@ -2807,6 +2808,12 @@ query_module (Dwfl_Module *mod,
if (!q->dw.module_name_matches(q->module_val))
return DWARF_CB_OK;
+ // Don't allow module("*kernel*") type expressions to match the
+ // elfutils module "kernel", which we refer to in the probe
+ // point syntax exclusively as "kernel.*".
+ if (q->dw.module_name == TOK_KERNEL && ! q->has_kernel)
+ return DWARF_CB_OK;
+
// Validate the machine code in this elf file against the
// session machine. This is important, in case the wrong kind
// of debuginfo is being automagically processed by elfutils.