From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796307477; b=j+Loh+CJhPRfEk1+DeWZQgMzKk5t+iwYc3A/SK+vVc0cXwrPKwkZBSP44TxmX/qQSm2U /1NAF3B67zzSnI4jkTNUYQKV/cPyIoXB3fD63BzSgVgtKMo/a/wSylsFE1EfthAAhOzG/ Ebv3ADKPwHtxD0B1ofA9ONqs7HkcSG6wKQbriZjlomMGt6j+K5xWhYPdEhvKJ+69mJDa7 tkIP3gHCx+ioZZfCkaYY8gwSQucgAtrXSh3gJYSSZ9bjuwNuP05jUZ3u1g2eabzrs0USz j3LjzT4ukjMaEDXpgj8DPe9BaybqOlqwbt+ckK/ZzM5rWkn3om01UJPO12792Pr2h6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796307477; h=Received:DKIM-Signature:Received:Message-ID:User-Agent:Date:From:To: Cc:Subject; bh=KPpj09gHyqLaHTMfQ0Q41sHWJWupMo1Ct8litt1YkdU=; b=QNR7sul0ZqdlIqJnrilE8QS1wBE+WExfBLPDADHtTfyt7mWkFb8a558wasuiK4BtkRqN w6j7XylpeG1V82FO31CpvChj6Pghgs77ireOuZ2wYwNZfdeXqS81HuWdBVP529gstHEH5 QveU9cvRC9QG7YvQ9fpVQqco0zGwCivyqrtOwywOhiQYIjRR3stXA7zmG4sHDY87T4Xi0 cB4yIZTxcI1Bn5ESgbo+JceP5UiWEeLvmzx9Sd5MPY2oomoqNfxyKFut8EV3qBimsZAi1 +0ar3kk4yFzBMICDnxk6KWzN3AzoyC2+n98NtBQvGsobGz0wPwhMq99tmm04Hn5O8jA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GtfZ4mnr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72439606A332 for ; Thu, 3 Dec 2026 14:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GtfZ4mnr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02A921F00898; Thu, 3 Dec 2026 14:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796307477; bh=KPpj09gHyqLaHTMfQ0Q41sHWJWupMo1Ct8litt1YkdU=; h=Date:From:To:Cc:Subject; b=GtfZ4mnrQFao87hsBfOAjWKwh+Z0cflGRF1WV9pLsLLrUirtCypdBb4DnxReQnVwJ wVXhGzbvYx6Eo1Qj8ZD9+8RMc/tsK9Ihen5qL4Z1PItzTrvZncwRtUABr1tCaud3v4 pWlzuo0U099g+XEqi+ra6mce4bdPRZicB9gPHdEsDfSANd4s05T9N5ASDR9xfnf+wB SoqqDEgd7nNY42EklG6sR14E7WaRBTz/KQOJTNYD5kSt/hHqEZ+MEBo6jm7S+fdyzo h7N0IX3I9/XYm4vXU/hI3wYLx/Gc5WY/DF893iKCX/jX7IZOrc0Q6nPMm9kqxOeJ5w TMIH+F+5yKs7Q== Received: from rostedt by gandalf with local (Exim 4.100.1) (envelope-from ) id 1xZ7dE-0000000C21J-0OxI; Thu, 03 Dec 2026 09:17:56 -0500 Message-ID: <20261203141725.845506016@kernel.org> User-Agent: quilt/0.69 Date: Thu, 03 Dec 2026 09:17:25 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , David Carlier , Lee Jones , Vincent Donnefort Subject: [for-linus][PATCH 0/8] tracing: Fixes for v7.4 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list tracing fixes for v7.4: - Fix lseek crash when reading recursed_functions file The recursed_functions file used the normal seq_lseek method for its lseek handler but if the file is open for WRONLY the seq isn't initialized and a call to lseek causes a NULL pointer dereference. - Fix filter glob matching on zero size strings Dynamic strings send a length of zero to the match functions to denote that the string is nul terminated and dynamic in size. But an update switched the regex_match_glob() handler to use glob_match_len() which expects a real length of the string. If len is zero, call the original glob_match() that expects a nul terminated string. - Use irqsave for reader lock in ring_buffer_poll_remote() The reader_lock can be taken in interrupt context and there's some places in the code that takes the reader_lock without disabling interrupts. - Avoid reader_lock deadlock during panic On panic, a ftrace dump can be called to see what lead up to the crash. Like in doing the dump from NMI, the reader_lock is not taken (a best effort is used to dump out the buffer when the system has crashed). Do not take the reader lock if the system is in panic. - Reject non-string fields for synthetic string fields A synthetic event is created via commands to the synthetic_event file. The commands specify fields for the new event and their types. Then events can trigger these synthetic events based on various conditions and pass their fields as the synthetic event fields. Reject non-string fields being used in synthetic string fields. - Free event filters after RCU synchronization Event filters are protected by RCU and when the internal code is done with a filter, it tries to do a "delayed free" where it allocates a descriptor to be used in an RCU and work queue lists and attaches the filter to it. Then it calls an RCU callback that processes this descriptor. If the descriptor fails to allocate, it then does the synchronization directly and then frees the filters. The issue is that filters can be freed from global functions that can be called from atomic context and these functions can not do the synchronization if the allocation of the descriptor fails. As they currently just free the filters, this is a bug as it leaves a race where the filters could still be used as no synchronization has taken place. Instead of allocating a separate descriptor to hold the RCU and work queue fields in a structure, just add those fields to the event_filter structure and always do the RCU call to free the filters. Not only does this fix the bug, it also simplifies the code and makes it a little smaller. - Fix trace_event_file leak on read-only instances When an instance is deleted it removes the files that were created from the eventfs file system. Since several files share the same descriptor that needs to be freed, only one of the registered files need to have a "release" method to delete the descriptor. The "enable" file was chosen as all events had this file. When the "enable" file is deleted, its release handler would be called and the descriptor would be freed. The issue is the introduction of read-only instances that did not have an "enable" file. When these instances are deleted, the file descriptors were not freed due to none of the registered files having a release method. Since all events have a "format" file for both read-only and normal instances, use that file instead for the release method. - Fix the "free on close" for backup instances Backup instances are copies of the persistent ring buffer that is copied on boot up so that the persistent ring buffer content can be saved and then the persistent ring buffer can be used immediately without losing the data from the previous boot. The backup instance has a feature that can be set to free it after the last event in its buffer has been read. There's no reason to keep a backup instance around that is empty as they are read-only and can not add more data to them. When the last bit of data is read the instance is marked as freed and any new open returns -ENODEV. The issue has been reported by user space applications that read multiple files in the instance directory looking for things like stats and such. When the last event is read the instance is marked as freed even before the file descriptors opened are not closed yet. The instance can not be freed because of open file descriptors but none of its files can be open again. Introduce another state to the instance that is autoremove_queued. In this state, files can still be opened, but once the last file is closed the instances is removed and nothing can then open a new file. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/fixes Head SHA1: a6a40ab36abb91e698b08cc7a0d3dc9455fcfaf4 David Carlier (2): tracing/filters: Fix glob matching on zero size string fields tracing: Fix trace_event_file leak on read-only instances Lee Jones (1): tracing/histograms: Reject non-string fields for synthetic string fields Masami Hiramatsu (Google) (1): tracing: Reject backup instance opens only after autoremove is queued Steven Rostedt (2): tracing: Fix crash on lseek of recursed_functions file in WRONLY mode tracing: Free all event filters after RCU synchronization Vincent Donnefort (2): ring-buffer: Use irqsave for the reader lock in ring_buffer_poll_remote ring-buffer: Avoid reader_lock deadlock during panic ---- kernel/trace/ring_buffer.c | 16 ++-- kernel/trace/trace.c | 12 ++- kernel/trace/trace.h | 9 ++ kernel/trace/trace_events.c | 6 +- kernel/trace/trace_events_filter.c | 157 ++++++++++++---------------------- kernel/trace/trace_events_hist.c | 11 ++- kernel/trace/trace_recursion_record.c | 2 +- 7 files changed, 93 insertions(+), 120 deletions(-)