From 305dd985458cad242a6ad489e5a2bc7a624e11e3 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 26 Jul 2024 16:02:04 -0400 Subject: [PATCH] Fix: event notifier: set eval_capture to false for kprobe and uprobe 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 Change-Id: I7ee7e33b9d12986d79aabefcbd5ef91ed2c6d690 --- src/probes/lttng-kprobes.c | 2 +- src/probes/lttng-uprobes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/probes/lttng-kprobes.c b/src/probes/lttng-kprobes.c index b30a6075..997bcfe0 100644 --- a/src/probes/lttng-kprobes.c +++ b/src/probes/lttng-kprobes.c @@ -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, ¬if_ctx); break; } diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index 38cd0f84..f70218be 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -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, ¬if_ctx); break; } -- 2.34.1