summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorfche <fche>2007-04-03 01:29:06 +0000
committerfche <fche>2007-04-03 01:29:06 +0000
commit0cbbf9d1cc127b8671892ca64d9e9202dc8786d0 (patch)
tree3998972e806acacdd87d5fa57ce06fbe95bd61f5 /tapsets.cxx
parent396afcee5ada2d207b7a6691d4b7ce473e7b2a65 (diff)
downloadsystemtap-steved-0cbbf9d1cc127b8671892ca64d9e9202dc8786d0.tar.gz
systemtap-steved-0cbbf9d1cc127b8671892ca64d9e9202dc8786d0.tar.xz
systemtap-steved-0cbbf9d1cc127b8671892ca64d9e9202dc8786d0.zip
2007-04-02 Frank Ch. Eigler <fche@redhat.com>
PR 3261. * tapsets.cxx (query_module): Reject elfutils module "kernel" unless kernel.* probe point used.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx11
1 files changed, 9 insertions, 2 deletions
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.