]> git.lttng.org Git - lttng-modules.git/commitdiff
Fix: event notifier: set eval_capture to false for kprobe and uprobe
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Jul 2024 20:02:04 +0000 (16:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Jul 2024 20:04:45 +0000 (16:04 -0400)
Trying to capture fields for kprobe and uprobe, event notifications
will end up dereferencing NULL pointers. Prevent execution of capture
code in those cases.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7ee7e33b9d12986d79aabefcbd5ef91ed2c6d690

src/probes/lttng-kprobes.c
src/probes/lttng-uprobes.c

index b30a60756abe3e8827843bceecfc5d1611016f2d..997bcfe0a0d8299809dbf0b4fe30dd36252e8efb 100644 (file)
@@ -78,7 +78,7 @@ int lttng_kprobes_event_handler_pre(struct kprobe *p, struct pt_regs *regs)
                        container_of(event, struct lttng_kernel_event_notifier, parent);
                struct lttng_kernel_notification_ctx notif_ctx;
 
-               notif_ctx.eval_capture = LTTNG_READ_ONCE(event_notifier->eval_capture);
+               notif_ctx.eval_capture = false;
                event_notifier->notification_send(event_notifier, NULL, NULL, &notif_ctx);
                break;
        }
index 38cd0f84c604a273e92b6b7d9bd8886070d505f6..f70218be79270802187d61a274382c57733a6197 100644 (file)
@@ -89,7 +89,7 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs *
                        container_of(event, struct lttng_kernel_event_notifier, parent);
                struct lttng_kernel_notification_ctx notif_ctx;
 
-               notif_ctx.eval_capture = LTTNG_READ_ONCE(event_notifier->eval_capture);
+               notif_ctx.eval_capture = false;
                event_notifier->notification_send(event_notifier, NULL, NULL, &notif_ctx);
                break;
        }
This page took 0.031713 seconds and 4 git commands to generate.