From d1f1c568e4e28b57156da4fce6b815a56166ecc6 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 19 Jan 2012 13:43:57 -0500 Subject: [PATCH] Don't init kernel tracer if not root (UID=0) No point of trying to init kernel tracer if the session daemon is not root. At this time, only UID=0 can load kernel modules and interact with the lttng kernel tracer. Reported-by: Daniel Thibault Signed-off-by: David Goulet --- lttng-sessiond/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 4828f1c17..7d8546d8e 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -3273,6 +3273,11 @@ static int process_client_msg(struct command_ctx *cmd_ctx) */ switch (cmd_ctx->lsm->domain.type) { case LTTNG_DOMAIN_KERNEL: + if (!is_root) { + ret = LTTCOMM_KERN_NA; + goto error; + } + /* Kernel tracer check */ if (kernel_tracer_fd == 0) { /* Basically, load kernel tracer modules */ -- 2.34.1