From nobody Sat Feb 7 20:39:53 2026 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02D0B27E049 for ; Sat, 24 Jan 2026 20:15:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769285709; cv=none; b=tYPuy0sWTww9jwg/XIarXT61TOPsnyw40bqMg5JESbk0NrINioB/2fFcN2YWkdNwlLtWWyzwAYflbiUz0WrvLegVTIet+PNltgcjJtGYZcDqBUOOgC8IZR8YQe7J5muPDByfEJRsuOYsM/fhjJUBrj3zPj2SKhBJm8OjWRbvYUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769285709; c=relaxed/simple; bh=WJ9Xvou/3ZxLz7kD6zf8SecN9ojQda//wopk05MMf+Y=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=WxM9wqqpqfoamV9tWDoqPKO0hvsKxiVqQKgbshedb7oq+loTSHHL6LKE9cvU02LLAVWU2XXdGvdLEMrZKfdgCVLtdlh3wkL0Ek9HfbbpgkewOUkHNkYb5FX/af+a37Y45MNCTFoFEF4gVgJiDF5fe3QZhbzZ4iWQsi+4QXcI4nI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6F05916030A; Sat, 24 Jan 2026 20:14:59 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf18.hostedemail.com (Postfix) with ESMTPA id 961CE2E; Sat, 24 Jan 2026 20:14:57 +0000 (UTC) Date: Sat, 24 Jan 2026 15:14:56 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Donglin Peng , Ian Rogers , Weigang He Subject: [GIT PULL] tracing: 1 crash fix and a few minor fixes Message-ID: <20260124151456.350f3464@robin> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspamout06 X-Rspamd-Queue-Id: 961CE2E X-Stat-Signature: 3kihqqyrhsej8uc6exzxdb83yuxtp7zu X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX188oJqNJYmI4auvg2cbkgc+aAUXdYADWn0= X-HE-Tag: 1769285697-991021 X-HE-Meta: U2FsdGVkX186DHBK0Ehu4Y83H3f9LPrdhQ3GUZHy26M/lOjIpf9YeSl08mkII7z6eb/L7BO8PQZIDgo9WzZSnfwm6eUDN8FEiEyVN150yTdxYXnU4yfvZZ+qkTmJJqkK4G3b6kOyjXN0//QXv+QOCr6Bht494dpL7620GSrEDMT3Xdmdm+tjgRNV5fkPu4wVyXWnfqMXE21dcRTHzwcUWr2p3gicfnFtPTaynaOg+zXwTKHGEIjwdHPpYtt9A9TLRzU6hAM+8fh8wfaZCJBJXb+vSqdo53akKVIwR54pE4jgWiyEbFlSwVDufp3XNzJ9QOm4PFw+9zMyIrfmbeNaQaqNUhN0AB2Z Content-Type: text/plain; charset="utf-8" Linus, tracing fixes for v6.19: - Fix a crash with passing a stacktrace between synthetic events A synthetic event is an event that combines two events into a single event that can display fields from both events as well as the time delta that took place between the events. It can also pass a stacktrace from the first event so that it can be displayed by the synthetic event (this is useful to get a stacktrace of a task scheduling out when blocked and recording the time it was blocked for). A synthetic event can also connect an existing synthetic event to another event. An issue was found that if the first synthetic event had a stacktr= ace as one of its fields, and that stacktrace field was passed to the new synthetic event to be displayed, it would crash the kernel. This was due = to the stacktrace not being saved as a stacktrace but was still marked as on= e. When the stacktrace was read, it would try to read an array but instead r= ead the integer metadata of the stacktrace and dereferenced a bad value. Fix this by saving the stacktrace field as a stracktrace. - Fix possible overflow in cmp_mod_entry() compare function A binary search is used to find a module address and if the addresses are greater than 2GB apart it could lead to truncation and cause a bad search result. Use normal compares instead of a subtraction between addresses to calculate the compare value. - Fix output of entry arguments in function graph tracer Depending on the configurations enabled, the entry can be two different types that hold the argument array. The macro FGRAPH_ENTRY_ARGS() is used to find the correct arguments from the given type. One location was missed and still referenced the arguments directly via entry->args and could produce the wrong value depending on how the kernel was configured. - Fix memory leak in scripts/tracepoint-update build tool If the array fails to allocate, the memory for the values needs to be freed and was not. Free the allocated values if the array failed to allocate. Please pull the latest trace-v6.19-rc6 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.19-rc6 Tag SHA1: 61089d5e2a044cd468c5a375f02c2d4fa441d4c2 Head SHA1: 361eb853c655288f3b5c8020f6cd95d69ffe6479 Donglin Peng (1): function_graph: Fix args pointer mismatch in print_graph_retval() Ian Rogers (1): tracing: Avoid possible signed 64-bit truncation Steven Rostedt (1): tracing: Fix crash on synthetic stacktrace field usage Weigang He (1): scripts/tracepoint-update: Fix memory leak in add_string() on failure ---- kernel/trace/trace.c | 8 ++++---- kernel/trace/trace_events_hist.c | 9 +++++++++ kernel/trace/trace_events_synth.c | 8 +++++++- kernel/trace/trace_functions_graph.c | 2 +- scripts/tracepoint-update.c | 2 ++ 5 files changed, 23 insertions(+), 6 deletions(-) --------------------------- diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index baec63134ab6..8bd4ec08fb36 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6115,10 +6115,10 @@ static int cmp_mod_entry(const void *key, const voi= d *pivot) unsigned long addr =3D (unsigned long)key; const struct trace_mod_entry *ent =3D pivot; =20 - if (addr >=3D ent[0].mod_addr && addr < ent[1].mod_addr) - return 0; - else - return addr - ent->mod_addr; + if (addr < ent[0].mod_addr) + return -1; + + return addr >=3D ent[1].mod_addr; } =20 /** diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index 5e6e70540eef..c97bb2fda5c0 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -2057,6 +2057,15 @@ static struct hist_field *create_hist_field(struct h= ist_trigger_data *hist_data, hist_field->fn_num =3D HIST_FIELD_FN_RELDYNSTRING; else hist_field->fn_num =3D HIST_FIELD_FN_PSTRING; + } else if (field->filter_type =3D=3D FILTER_STACKTRACE) { + flags |=3D HIST_FIELD_FL_STACKTRACE; + + hist_field->size =3D MAX_FILTER_STR_VAL; + hist_field->type =3D kstrdup_const(field->type, GFP_KERNEL); + if (!hist_field->type) + goto free; + + hist_field->fn_num =3D HIST_FIELD_FN_STACK; } else { hist_field->size =3D field->size; hist_field->is_signed =3D field->is_signed; diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_= synth.c index 4554c458b78c..45c187e77e21 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -130,7 +130,9 @@ static int synth_event_define_fields(struct trace_event= _call *call) struct synth_event *event =3D call->data; unsigned int i, size, n_u64; char *name, *type; + int filter_type; bool is_signed; + bool is_stack; int ret =3D 0; =20 for (i =3D 0, n_u64 =3D 0; i < event->n_fields; i++) { @@ -138,8 +140,12 @@ static int synth_event_define_fields(struct trace_even= t_call *call) is_signed =3D event->fields[i]->is_signed; type =3D event->fields[i]->type; name =3D event->fields[i]->name; + is_stack =3D event->fields[i]->is_stack; + + filter_type =3D is_stack ? FILTER_STACKTRACE : FILTER_OTHER; + ret =3D trace_define_field(call, type, name, offset, size, - is_signed, FILTER_OTHER); + is_signed, filter_type); if (ret) break; =20 diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_func= tions_graph.c index b1e9c9913309..1de6f1573621 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -901,7 +901,7 @@ static void print_graph_retval(struct trace_seq *s, str= uct ftrace_graph_ent_entr trace_seq_printf(s, "%ps", func); =20 if (args_size >=3D FTRACE_REGS_MAX_ARGS * sizeof(long)) { - print_function_args(s, entry->args, (unsigned long)func); + print_function_args(s, FGRAPH_ENTRY_ARGS(entry), (unsigned long)func); trace_seq_putc(s, ';'); } else trace_seq_puts(s, "();"); diff --git a/scripts/tracepoint-update.c b/scripts/tracepoint-update.c index 90046aedc97b..5cf43c0aac89 100644 --- a/scripts/tracepoint-update.c +++ b/scripts/tracepoint-update.c @@ -49,6 +49,8 @@ static int add_string(const char *str, const char ***vals= , int *count) array =3D realloc(array, sizeof(char *) * size); if (!array) { fprintf(stderr, "Failed memory allocation\n"); + free(*vals); + *vals =3D NULL; return -1; } *vals =3D array;