lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251107082444.45c4536d@gandalf.local.home>
Date: Fri, 7 Nov 2025 08:24:44 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu
 <mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Tomas Glozar <tglozar@...hat.com>, John Kacur <jkacur@...hat.com>, Zhang
 Chujun <zhangchujun@...s.chinamobile.com>, Zilin Guan <zilin@....edu.cn>
Subject: [GIT PULL] tracing: A few minor fixes for v6.18


Linus,

Fixes for tracing:

- Check for reader catching up in ring_buffer_map_get_reader()

  If the reader catches up to the writer in the memory mapped ring buffer
  then calling rb_get_reader_page() will return NULL as there's no
  pages left. But this isn't checked for before calling rb_get_reader_page()
  and the return of NULL causes a warning.

  If it is detected that the reader caught up to the writer, then simply
  exit the routine.

- Fix memory leak in histogram create_field_var()

  The couple of the error paths in create_field_var() did not properly clean
  up what was allocated. Make sure everything is freed properly on error.

- Fix help message of tools latency_collector

  The help message incorrectly stated that "-t" was the same as "--threads"
  whereas "--threads" is actually represented by "-e".


Please pull the latest trace-v6.18-rc4 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.18-rc4

Tag SHA1: a9d5bb4a7261f61be9248ee46ff77fd0c6261970
Head SHA1: 53afec2c8fb2a562222948cb1c2aac48598578c9


Steven Rostedt (1):
      ring-buffer: Do not warn in ring_buffer_map_get_reader() when reader catches up

Zhang Chujun (1):
      tracing/tools: Fix incorrcet short option in usage text for --threads

Zilin Guan (1):
      tracing: Fix memory leaks in create_field_var()

----
 kernel/trace/ring_buffer.c                | 4 ++++
 kernel/trace/trace_events_hist.c          | 6 ++++--
 tools/tracing/latency/latency-collector.c | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
---------------------------
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 1244d2c5c384..afcd3747264d 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -7344,6 +7344,10 @@ int ring_buffer_map_get_reader(struct trace_buffer *buffer, int cpu)
 		goto out;
 	}
 
+	/* Did the reader catch up with the writer? */
+	if (cpu_buffer->reader_page == cpu_buffer->commit_page)
+		goto out;
+
 	reader = rb_get_reader_page(cpu_buffer);
 	if (WARN_ON(!reader))
 		goto out;
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 1d536219b624..6bfaf1210dd2 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -3272,14 +3272,16 @@ static struct field_var *create_field_var(struct hist_trigger_data *hist_data,
 	var = create_var(hist_data, file, field_name, val->size, val->type);
 	if (IS_ERR(var)) {
 		hist_err(tr, HIST_ERR_VAR_CREATE_FIND_FAIL, errpos(field_name));
-		kfree(val);
+		destroy_hist_field(val, 0);
 		ret = PTR_ERR(var);
 		goto err;
 	}
 
 	field_var = kzalloc(sizeof(struct field_var), GFP_KERNEL);
 	if (!field_var) {
-		kfree(val);
+		destroy_hist_field(val, 0);
+		kfree_const(var->type);
+		kfree(var->var.name);
 		kfree(var);
 		ret =  -ENOMEM;
 		goto err;
diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c
index cf263fe9deaf..ef97916e3873 100644
--- a/tools/tracing/latency/latency-collector.c
+++ b/tools/tracing/latency/latency-collector.c
@@ -1725,7 +1725,7 @@ static void show_usage(void)
 "-n, --notrace\t\tIf latency is detected, do not print out the content of\n"
 "\t\t\tthe trace file to standard output\n\n"
 
-"-t, --threads NRTHR\tRun NRTHR threads for printing. Default is %d.\n\n"
+"-e, --threads NRTHR\tRun NRTHR threads for printing. Default is %d.\n\n"
 
 "-r, --random\t\tArbitrarily sleep a certain amount of time, default\n"
 "\t\t\t%ld ms, before reading the trace file. The\n"

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ