From 64211010978d0e35c80ec7c119f1986a48f97543 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Mon, 9 Nov 2009 14:50:52 -0500 Subject: Don't reference global variable modpath in insert_module and its helpers. This allows insert_module to to be used for loading the signed uprobes.ko module. Allow the use of $$parms and $$return in uprobes based probes for unprivileged users. Re-add management of module signatures in the cache. Don't know why it was removed. --- tapsets.cxx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index d2c33349..6566c89f 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -358,6 +358,9 @@ struct dwarf_derived_probe: public derived_probe void emit_probe_local_init(translator_output * o); void getargs(std::set &arg_set) const; + void emit_unprivileged_assertion (translator_output*); + void print_dupe_stamp(ostream& o); + // Pattern registration helpers. static void register_statement_variants(match_node * root, dwarf_builder * dw); @@ -672,6 +675,11 @@ struct dwarf_builder: public derived_probe_builder probe_point * location, literal_map_t const & parameters, vector & finished_results); + + // No action required. These probes are allowed for unprivileged users. + // as process owners. + virtual void check_unprivileged (const systemtap_session & sess, + const literal_map_t & parameters) {} }; @@ -2307,6 +2315,8 @@ dwarf_var_expanding_visitor::visit_target_symbol (target_symbol *e) if (! lvalue) ec->code += "/* pure */"; + + ec->code += "/* unprivileged */"; } catch (const semantic_error& er) { @@ -2949,6 +2959,24 @@ dwarf_derived_probe::getargs(std::set &arg_set) const } +void +dwarf_derived_probe::emit_unprivileged_assertion (translator_output* o) +{ + // These probes are allowed for unprivileged users, but only in the + // context of processes which they own. + emit_process_owner_assertion (o); +} + + +void +dwarf_derived_probe::print_dupe_stamp(ostream& o) +{ + // These probes are allowed for unprivileged users, but only in the + // context of processes which they own. + print_dupe_stamp_unprivileged_process_owner (o); +} + + void dwarf_derived_probe::register_statement_variants(match_node * root, dwarf_builder * dw) @@ -5569,6 +5597,8 @@ tracepoint_var_expanding_visitor::visit_target_symbol_arg (target_symbol* e) else ec->code += "/* pure */"; + ec->code += "/* unprivileged */"; + dw.sess.functions[fdecl->name] = fdecl; // Synthesize a functioncall. -- cgit