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. --- runtime/staprun/staprun.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'runtime/staprun/staprun.c') diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index c5651d9a..078be4cf 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -129,14 +129,12 @@ static int enable_uprobes(void) if (run_as(0, 0, 0, argv[0], argv) == 0) return 0; + /* This module may be signed, so use insert_module to load it. */ snprintf (runtimeko, sizeof(runtimeko), "%s/uprobes/uprobes.ko", (getenv("SYSTEMTAP_RUNTIME") ?: PKGDATADIR "/runtime")); dbug(2, "Inserting uprobes module from SystemTap runtime %s.\n", runtimeko); - i = 0; - argv[i++] = "/sbin/insmod"; - argv[i++] = runtimeko; - argv[i] = NULL; - if (run_as(0, 0, 0, argv[0], argv) == 0) + argv[0] = NULL; + if (insert_module(runtimeko, NULL, argv, assert_uprobes_module_permissions) == 0) return 0; return 1; /* failure */ @@ -150,7 +148,7 @@ static int insert_stap_module(void) if (snprintf_chk(special_options, sizeof (special_options), "_stp_bufsize=%d", buffer_size)) return -1; - return insert_module(modpath, special_options, modoptions); + return insert_module(modpath, special_options, modoptions, assert_stap_module_permissions); } static int remove_module(const char *name, int verb); -- cgit