[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230901151039.125186-3-vschneid@redhat.com>
Date: Fri, 1 Sep 2023 17:10:37 +0200
From: Valentin Schneider <vschneid@...hat.com>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Cc: Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>
Subject: [PATCH 2/4] tracing/filters: Fix double-free of struct filter_pred.mask
When a cpulist filter is found to contain a single CPU, that CPU is saved
as a scalar and the backing cpumask storage is freed.
Also NULL the mask to avoid a double-free once we get down to
free_predicate().
Reported-by: Steven Rostedt <rostedt@...dmis.org>
Signed-off-by: Valentin Schneider <vschneid@...hat.com>
---
kernel/trace/trace_events_filter.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index c06e1d596f4b9..eb331e8b00b61 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1773,6 +1773,7 @@ static int parse_pred(const char *str, void *data,
if (single) {
pred->val = cpumask_first(pred->mask);
kfree(pred->mask);
+ pred->mask = NULL;
}
if (field->filter_type == FILTER_CPUMASK) {
--
2.31.1
Powered by blists - more mailing lists