From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 60E383EDE7D for ; Tue, 7 Jul 2026 13:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783431982; cv=none; b=WxkEsEvn76UhkBodNelZaeGREa1HIenaNG4rPJdHk5vROuAj6APZmWAZ+ERcwPbOwhyai50ydq1nK8jaU4/g7kGuL1RxNGx3iE9zsgVHd1uWuLfCmBtnC/3bNPi1frHD77/CTIrSvJzSkExWoZbI26o6tL5jkg2oZSEeMQ6ZUl8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783431982; c=relaxed/simple; bh=WXWpE6KBMwMhEAtH4FfAdewpOUMiBAFkCPOqhGCtDGI=; h=Message-ID:Date:From:To:Cc:Subject; b=aEwu5UBTlmMUBfuBXRZrN+7SjI2A1gvtYB22LoD/5Myywtxf3fmpG3K0H5uLYUmRyJL5l8M+Gld3gHlWPm+rz3kHeUpkApvMHAN5Ra8JhXwakjzaUUD7rHl/CI3MJqjqBj5qlVTgkGsifA/H1gR8Qv6mbQN7xUWIhraA7GAb9SM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xw45Ora3; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xw45Ora3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 049601F000E9; Tue, 7 Jul 2026 13:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783431980; bh=/yJKOLf4cxBQei53/gJNUbXm+g4j6IY+9HBFHlrPMAo=; h=Date:From:To:Cc:Subject; b=Xw45Ora3CbYLipbS4zPWR3mf/WC27aQ3immOSqRRSxNRhZLc9BejW6yBy4h1Qv9jr t5YwpqOvilEvSApY5E12NKj/kvIh6VBgqD3qzwGCJE7mh+AmJ4vHw/RCLF+T/8mDQt ImaYLIQcLxRqg5cbiTavxPZfeXipdGfCgsVmV7HoHYUhvNAeGLsAok1/xZcX8DSVLx TJEF9p2mfVbkMMt6atUvvUDibHPzcwVR4NMWagX+WfUw6yknLdCFIibX6lK2/EgzVa R8r5ui7yJJZ3GCdnXdjDlz/U8GYH+mrZROTbSrkBgkiu/7bT+XOx8iyiBR3/NV62IB RwnW9pDXdKNSA== Received: from rostedt by gandalf with local (Exim 4.99.4) (envelope-from ) id 1wh67z-00000000h0c-0h8Y; Tue, 07 Jul 2026 09:46:23 -0400 Message-ID: <20260707134604.275787924@kernel.org> User-Agent: quilt/0.69 Date: Tue, 07 Jul 2026 09:46:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-linus][PATCH 00/13] tracing: Fixes for 7.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: tracing fixes for 7.2: - Free field in error path of synthetic event parse In __create_synth_event() the field was allocated but was not freed in the error path. - Fix ring_buffer_event_length() on 8 byte aligned architectures On architectures with CONFIG_HAVE_64BIT_ALIGNED_ACCESS set to y, the ring_buffer_event_length() may return the wrong size. This is because archs with that config set will always use the "big event meta header" as that is 8 bytes keeping the payload 8 bytes aligned, even when a 4 byte header could hold the size of the event. But ring_buffer_event_length() doesn't take this into account and only subtracts 4 bytes for the meta header in the length when it should have subtracted 8 bytes. - Have osnoise wait for a full rcu synchronization on unregister osnoise_unregister_instance() used to call synchronize_rcu() before freeing its copy of the instance but was switched to kfree_rcu(). The osniose tracer has code that traverses the instances that it uses, and inst is just a pointer to that instance. By using kfree_rcu() instead of synchronize_rcu(), the instance that the inst pointer is pointing to can be freed while the osnoise code is still referencing it. That is, a rmdir on an instance first unregisters the tracer. When the unregister finishes, the rmdir expects that the tracer is finished with the instance that it is using. By putting back the synchronize_rcu() in osnoise_unregister_instance() the unregistering of osnoise will now return when all the users of the instance have finished. - Remove an unused setting of "ret" in tracing_set_tracer() - Fix a race between ring buffer setting subbuf_order and reading it When ring_buffer_subbuf_order_set() is called at the same time as ring_buffer_read_page(), there is a race that the subbuf_size will change and the read_page will allocate one size and then initialize it as another size. Fix this by moving the reading of the subbuf_size into the locking and use a local variable to use it for all other transactions when the lock is released. It is OK if it changes, as long as the allocated page is still considered the same throughout the read function. - Fix ring_buffer_read_page() copying events The commit that changed ring_buffer_read_page() to show dropped events from the buffer itself, split the "commit" variable between the commit value (with flags) and "size" that holds the size of the sub-buffer. A cut and paste error changed the test of the reading from checking the size of the buffer to the size of the event causing reads to only read one event at a time. - Make tracepoint_printk a static variable When the tracing sysctl knobs were move from sysctl.c to trace.c, the variable tracepoint_printk no longer needed to be global. Make it static. - Fix user_event use-after-free of enabler descriptor When the enabler is removed from the link list, it is freed immediately. But it is protected via RCU and needs to be freed via kfree_rcu(). - Fix some typos - Fix NULL pointer dereference in func_set_flag() The flags update of the function tracer first checks if the value of the flag is the same and exits if they are, and then it checks if the current tracer is the function tracer and exits if it isn't. The problem is that these checks need to be in a reversed order, as if the tracer isn't the function tracer, then the flag being checked may not exist. Reverse the order of these checks. - Fix ufs core trace events to not dereference a pointer in TP_printk() The TP_printk() part of the TRACE_EVENT() macro is called when the user reads the "trace" file. This can be seconds, minutes, hours, days, weeks, and even months after the data was recorded into the ring buffer. Thus, saving a pointer to an object into the ring buffer and then dereferencing it from TP_printk() can cause harm as the object the pointer is pointing to may no longer exist. Fix all the trace events in ufs core to save the device name in the ring buffer instead of dereferencing the device descriptor from TP_printk(). - Prevent out-of-bound reads in glob matching of trace events The filter logic of events allows simple glob logic to add wild cards to filter on strings. But some events have fields that may not have a terminating 'nul' character. This may cause the glob matching to go beyond the string. Change the logic to always pass in the length of the field that is being matched. - Add no-rcu-check version of trace_##event##_enabled() The trace_##event##_enabled() usually wraps trace events to do extra work that is only needed when the trace event is enabled. But this can hide events that are placed in locations where RCU is not watching, and can make lockdep not see these bugs when the event is not enabled. The trace_##event##_enabled() was updated to always test to make sure RCU is watching to catch locations that may call events without RCU being active. This caused a false positive for the irq_disabled() and related events. As that use trace_irq_disabled_enabled() to force RCU to be watching when the event is enabled via the ct_irq_enter() function, calls the event, and then calls ct_irq_exit() to put RCU back to its original state. The trace_irq_disabled_enabled() should not trigger a warning when RCU is not watching because the code within its block handles the case properly. Make a __trace_##event##_enabled() version for this event to use that doesn't check RCU is watching as it handles the case when it isn't. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/fixes Head SHA1: 9cc30885fbd3a59d81f70414bc7a13cbc148f60e Ben Dooks (1): tracing: make tracepoint_printk static as not exported Crystal Wood (1): tracing/osnoise: Call synchronize_rcu() when unregistering David Carlier (1): ring-buffer: Fix ring_buffer_read_page() copying only one event per page Hui Wang (1): ring-buffer: Fix event length with forced 8-byte alignment Huihui Huang (1): tracing: Prevent out-of-bounds read in glob matching Michael Bommarito (1): tracing/user_events: Fix use-after-free of enabler in user_event_mm_dup() Steven Rostedt (2): ufs: core: tracing: Do not dereference pointers in TP_printk() tracing: Add a no-rcu-check version of trace_##event##_enabled() Wayen.Yan (1): tracing: Remove unused ret assignment in tracing_set_tracer() Yash Suthar (1): ring_buffer: Check page order under reader_lock Yu Peng (1): tracing/synthetic: Free pending field on error path Yuanhe Shu (1): tracing: Fix NULL pointer dereference in func_set_flag() Yudistira Putra (1): samples: ftrace: Fix typos in benchmark comment ---- drivers/ufs/core/ufs_trace.h | 36 +++++++++++++++++++++++++++--------- include/linux/glob.h | 1 + include/linux/tracepoint.h | 12 +++++++++++- kernel/trace/ring_buffer.c | 25 +++++++++++++++++-------- kernel/trace/trace.c | 3 +-- kernel/trace/trace_events_filter.c | 6 ++---- kernel/trace/trace_events_synth.c | 6 ++++-- kernel/trace/trace_events_user.c | 10 +++++++++- kernel/trace/trace_functions.c | 8 ++++---- kernel/trace/trace_osnoise.c | 4 +++- kernel/trace/trace_preemptirq.c | 2 +- lib/glob.c | 31 +++++++++++++++++++++++++++++-- samples/ftrace/ftrace-ops.c | 4 ++-- 13 files changed, 111 insertions(+), 37 deletions(-)