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: <20250720145339.5f09ac0f@gandalf.local.home>
Date: Sun, 20 Jul 2025 14:53:39 -0400
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>
Subject: [GIT PULL] tracing: Fixes for 6.16


Linus,

Tracing fixes for 6.16:

- Fix timerlat with use of FORTIFY_SOURCE

  FORTIFY_SOURCE was added to the stack tracer where it compares the
  entry->caller array to having entry->size elements.

  timerlat has the following:

     memcpy(&entry->caller, fstack->calls, size);
     entry->size = size;

  Which triggers FORTIFY_SOURCE as the caller is populated before the
  entry->size is initialized.

  Swap the order to satisfy FORTIFY_SOURCE logic.

- Add down_write(trace_event_sem) when adding trace events in modules

  Trace events being added to the ftrace_events array are protected by
  the trace_event_sem semaphore. But when loading modules that have
  trace events, the addition of the events are not protected by the
  semaphore and loading two modules that have events at the same time
  can corrupt the list.

  Also add a lockdep_assert_held(trace_event_sem) to
  _trace_add_event_dirs() to confirm its held when iterating the list.


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


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.16-rc5

Tag SHA1: 3fa4ea79493691015e6e08d752e502a80d3364a6
Head SHA1: b5e8acc14dcb314a9b61ff19dcd9fdd0d88f70df


Steven Rostedt (1):
      tracing: Add down_write(trace_event_sem) when adding trace event

Tomas Glozar (1):
      tracing/osnoise: Fix crash in timerlat_dump_stack()

----
 kernel/trace/trace_events.c  | 5 +++++
 kernel/trace/trace_osnoise.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
---------------------------
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 120531268abf..d01e5c910ce1 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -3136,7 +3136,10 @@ __register_event(struct trace_event_call *call, struct module *mod)
 	if (ret < 0)
 		return ret;
 
+	down_write(&trace_event_sem);
 	list_add(&call->list, &ftrace_events);
+	up_write(&trace_event_sem);
+
 	if (call->flags & TRACE_EVENT_FL_DYNAMIC)
 		atomic_set(&call->refcnt, 0);
 	else
@@ -3750,6 +3753,8 @@ __trace_add_event_dirs(struct trace_array *tr)
 	struct trace_event_call *call;
 	int ret;
 
+	lockdep_assert_held(&trace_event_sem);
+
 	list_for_each_entry(call, &ftrace_events, list) {
 		ret = __trace_add_new_event(call, tr);
 		if (ret < 0)
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 6819b93309ce..fd259da0aa64 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -637,8 +637,8 @@ __timerlat_dump_stack(struct trace_buffer *buffer, struct trace_stack *fstack, u
 
 	entry = ring_buffer_event_data(event);
 
-	memcpy(&entry->caller, fstack->calls, size);
 	entry->size = fstack->nr_entries;
+	memcpy(&entry->caller, fstack->calls, size);
 
 	trace_buffer_unlock_commit_nostack(buffer, event);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ