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(). Link: https://lkml.kernel.org/r/20230901151039.125186-3-vschneid@redhat.com Cc: Masami Hiramatsu <mhiramat@kernel.org> Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Valentin Schneider <vschneid@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Родитель
9af4058493
Коммит
1caf7adb9e
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче