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 8D3E91531E8 for ; Sun, 9 Aug 2026 02:32:15 +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=1786242736; cv=none; b=R3VyaFZG3FECSjTTvj1Wzqk6CWuBpTIYkfZdo+HLgBxsEKXhNMEJkHqAahjKODZLd15mqxzyQrqgxUGWKZCC8xOnxyOktMth8+oVGUMP3QXd+1hcOT3YW1B+1MxpvhoTN20UYzFLXO9kFUPcqajQkjcTBi0fniTxZm+aQ9slrXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786242736; c=relaxed/simple; bh=BRJ5ryFYHZqOfVREMqYn2rwNjkLA+QpXfah72R3/DeU=; h=Message-ID:Date:From:To:Cc:Subject; b=JhgOnBSFCLFfxgidZK2wkpNQ1CRYbf+EQ0VMcO0ASmD9n/6ownginR9Jvs42qybwXBAzG/46VjuWqmpERZOXRzpvFsezwXmA0gPMgljA5whAGMKydRMf/gMUSNnRGXucZoMYzBZFlcibwumUJMPkMVmSX8C0TJGLTW3OSZQjYS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X7qlKBF6; 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="X7qlKBF6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F8A21F00A3A; Sun, 9 Aug 2026 02:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786242735; bh=PXWZakg4UKAQF17eKaY1OdekiTPQXywA0ORMyILKEXI=; h=Date:From:To:Cc:Subject; b=X7qlKBF6/sV9pVcUHAzqT1tvRbbwz8PWRInQhs06nKT0Fk5YW/ZITPNvZ3OLDja7j v9lJqpZ0z0gUeECfmbff4rvH/1xwSKTNMPAeIuc2XuOmdaKQQamhRHs53LoS6Qg+tP ZtE1Bxrz6qvsbXXs5fRLWbxD/C5Hy0+jta7L2B3FiM2+AP96oosgaX76ggrXxw+foS xW6Ho8XDnfUuklJ9iJB9FAuNK98Mhe1krF03SkSO1VswaiE8w0YuSpotsvUUKoAd9S pgXyl7jDIg1fmUODZB0rYW9tzUh1h1WsTeZ4QEwf6ZNauW/ontOkCthzFrLyPqfgJI jBOuZ1WdDh9ew== Received: from rostedt by gandalf with local (Exim 4.99.4) (envelope-from ) id 1wstKn-00000001N2F-1Q65; Sat, 08 Aug 2026 22:32:21 -0400 Message-ID: <20260809023144.852271250@kernel.org> User-Agent: quilt/0.69 Date: Sat, 08 Aug 2026 22:31:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-linus][PATCH 00/12] 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: - Fix use-after-free in eventfs_remove_rec() The freeing of the eventfs_inode children used list_for_each_entry() where the child is freed via srcu, but there's still a chance that it gets freed. It should be using list_for_each_entry_safe(). - Fix eventfs_inode SRCU use of list in freeing The iterator uses an SRCU protected list walk on the eventfs inodes. The eventfs inode uses its "list" field in a union with the RCU list head. When the inode gets added to the SRCU list it immediately corrupts the list pointer and can cause an issue with the iterator. Move the RCU list head to be shared with the children list head which allows the iterator to check the parent inode if is freed before referencing the child. Have the iterator check the parent "is_freed" field and break out if it is set. Also add memory barriers to make sure the ordering is correct. - Fix various RCU synchronization issues with direct_functions Updates to direct_functions have some missing RCU protection and synchronization. Restructure the code a bit to make sure updates to the direct_functions are protected. - Remove an unneeded comma from a scope_guard() There's a spurious comma in a scope_guard(). Remove it. - Fix race in per CPU buffer swap in the ring buffer When a per CPU buffer swap happens, it must make sure that it doesn't occur while a writer is active. Instead it returns an -EBUSY. But there's a small race window when a writer moves from one sub-buffer to the next that it resets the "committing" counter. If a swap happens at that moment, the buffer used for the commit of an event will not match the buffer the event is actually on. Instead of using the "committing" counter, use the recursive detection counter that does not get reset when the writer crosses sub-buffers. - Fix off-by-one in ftrace_free_mem() The function ftrace_free_mem() gets an "end_ptr" as a parameter that is exclusive to the rang to be freed. But its value is used to search for the records that expects an inclusive value. Subtract one from the parameter to convert it to an inclusive range. - Disable resizing of the ring buffer for persistent buffers Resizing the persistent buffer has undefined behavior. Prevent it from being resized. - Disable changing ring buffer subbuf order when resizing is disabled The ring buffer subbuffer order can not be changed during resizing. Use that instead of just checking if the buffer is mapped as mapped buffers also have resizing disabled. - Initialize subbuf_order of reader pages when they are created In rb_allocate_cpu_buffer() the bpage->order is not updated to the current subbuf_order leaving it as zero. This value is used when the page is freed. - Fix test_ringbuffer() to test for ERR_PTR before calling kthread_stop() The rb_threads[] array is assigned the output of kthread_run_on_cpu() which could return an ERR_PTR. At the end of the test, all threads in the array are cleaned up by kthread_stop() passing in the value in the array if it isn't zero. But if the array contains an ERR_PTR, kthread_stop() will not be able to handle it properly. Please pull the latest trace/fixes tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/fixes Head SHA1: 91542863abade2fd4f2b361991f5386ad9d19c8c Hui Su (1): ring-buffer: Fix crash passing ERR_PTR to kthread_stop() Josh Poimboeuf (1): ftrace: Fix off-by-one fentry site disable in ftrace_free_mem() Leon Hwang (4): ftrace: Protect direct_functions in ftrace_find_rec_direct ftrace: Protect direct_functions in update_ftrace_direct_del ftrace: Protect direct_functions in update_ftrace_direct_mod ftrace: Drop extra comma in trace_buffered_event_enable Shuangpeng Bai (1): eventfs: Fix use-after-free in eventfs_remove_rec() Steven Rostedt (1): eventfs: Use children field for rcu head and add memory barriers Tengda Wu (1): ring-buffer: Use current_context for safe per-CPU buffer swap Vincent Donnefort (3): ring-buffer: Prevent resizing of persistent ring buffer ring-buffer: Prevent subbuf order change when resizing is disabled ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer() ---- fs/tracefs/event_inode.c | 28 ++++++++++++++++++++++++++-- fs/tracefs/internal.h | 4 ++-- kernel/trace/ftrace.c | 33 +++++++++++++++++++++++---------- kernel/trace/ring_buffer.c | 15 +++++++++------ kernel/trace/trace.c | 2 +- 5 files changed, 61 insertions(+), 21 deletions(-)