From nobody Sun May 24 19:34:47 2026 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) (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 81E1431F982 for ; Thu, 21 May 2026 22:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779401267; cv=none; b=cvjIcSFJsfjGspCGwvB9hmQWTuzCHCHsdBQ4OFrJ2hUt9ETRWE5mvxxxhQIT9Y8fr1Bcpk2iLscWehIdoU6pYnIOWZu9MbWgVXFMWTiYBVvPqQQKxRg/kkTwTZe0q1whcrpViNN/PZZ2cro54pYJom6LJoF6yjeFT4uoPzUlXlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779401267; c=relaxed/simple; bh=GDrsmgFFhMX8+uNrcuIrpxN8iTByJsoDMuYIUJSSB+0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=T16kUoZLFAcHIcjfHsyHwdVIpXnoDn2+LC5jWtyN99Vy3BrcOkrsJkQCoEBZpF35e65nPyAw/exStyjowCuVbdx/LjCfxPNQIaxdaYR+qINL1kjv4sHOBtJC+CAwvQAfHtqi0YJMEgpc0/xuIo7RmBGkD6vJEg9EMm5ZXkXHCQo= 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.12 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 (lb01a-stub [10.200.18.249]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4A465A0795; Thu, 21 May 2026 22:07:44 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf18.hostedemail.com (Postfix) with ESMTPA id 91C7F2F; Thu, 21 May 2026 22:07:42 +0000 (UTC) Date: Thu, 21 May 2026 18:08:03 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , David Carlier Subject: [GIT PULL] tracing: Fixes for 7.1 Message-ID: <20260521180803.5956d03c@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-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-Queue-Id: 91C7F2F X-Rspamd-Server: rspamout06 X-Stat-Signature: rx1fo19wwqdcm1beb5sf8ot4cjosy5pf X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX18lQIkuEWod5+1W5s9t3DSDuzaJEe/mnMI= X-HE-Tag: 1779401262-763190 X-HE-Meta: U2FsdGVkX19y+tnio7qHmSfn1TBHC+fXy1Hkzcx9z3NqA9Uirbu5119PAbue4c/8YcJHlgvQRrSn9sf3eRYS13GMD4CfK7EVOZny/Tny29VLFH6SoHJpXoKRKWA5lfK7OioZj8g4zepImd9z88pCzGnYTLTRgsSjAEWYHg1gbAPnxOGKZjbxJTRro1rpJIbeKWEW+4V3IpqIANDjukATfeOygKzG9X6CKMn7ahuhx7lvqryesp6QzdHxJp1X1vSG0/lkYDnHDF+UOH/4MXoBeP8jz+mXRgxKl0tgmKBXphF2YcsnT/b8FrRlbAcCipzManHYn1KvWXCDowa3jlKwwM6qN8Ir2EhX Content-Type: text/plain; charset="utf-8" Linus, tracing fixes for v7.1: - Avoid NULL return from hist_field_name() The function hist_field_name() is directly passed to a strcat() which does not handle "NULL" characters. Return a zero length string when size is greater than the limit. This is used only to output already created histograms and no field currently is greater than the limit. But it should still not return NULL. - Do not call map->ops->elt_free() on allocation failure When elt_alloc() fails, it should not call the map->ops->elt_free() function if it exists, as that function may not be able to handle the free on allocation failures. The ->elt_free() should only be called when elt_alloc() succeeds. Please pull the latest trace-v7.1-rc4 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v7.1-rc4 Tag SHA1: 29687dffda8036a4a5d37fc65205c44189c81a80 Head SHA1: 8f0f5c4fb9df0e19a341e0c6ed8dc4fda9124f03 David Carlier (1): tracing: Avoid NULL return from hist_field_name() on truncation Masami Hiramatsu (Google) (1): tracing: Do not call map->ops->elt_free() if elt_alloc() fails ---- kernel/trace/trace_events_hist.c | 6 ++---- kernel/trace/tracing_map.c | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) --------------------------- diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index 0dbbf6cca9bc..eb2c2bc8bc3d 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1369,10 +1369,8 @@ static const char *hist_field_name(struct hist_field= *field, len =3D snprintf(full_name, sizeof(full_name), fmt, field->system, field->event_name, field->name); - if (len >=3D sizeof(full_name)) - return NULL; - - field_name =3D full_name; + if (len < sizeof(full_name)) + field_name =3D full_name; } else field_name =3D field->name; } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index bf1a507695b6..0dd7927df22a 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -386,13 +386,11 @@ static void tracing_map_elt_init_fields(struct tracin= g_map_elt *elt) } } =20 -static void tracing_map_elt_free(struct tracing_map_elt *elt) +static void __tracing_map_elt_free(struct tracing_map_elt *elt) { if (!elt) return; =20 - if (elt->map->ops && elt->map->ops->elt_free) - elt->map->ops->elt_free(elt); kfree(elt->fields); kfree(elt->vars); kfree(elt->var_set); @@ -400,6 +398,17 @@ static void tracing_map_elt_free(struct tracing_map_el= t *elt) kfree(elt); } =20 +static void tracing_map_elt_free(struct tracing_map_elt *elt) +{ + if (!elt) + return; + + /* Only objects initialized with alloc_elt() should be passed to free_elt= ().*/ + if (elt->map->ops && elt->map->ops->elt_free) + elt->map->ops->elt_free(elt); + __tracing_map_elt_free(elt); +} + static struct tracing_map_elt *tracing_map_elt_alloc(struct tracing_map *m= ap) { struct tracing_map_elt *elt; @@ -444,7 +453,7 @@ static struct tracing_map_elt *tracing_map_elt_alloc(st= ruct tracing_map *map) } return elt; free: - tracing_map_elt_free(elt); + __tracing_map_elt_free(elt); =20 return ERR_PTR(err); }