From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F074D242D72; Sun, 1 Mar 2026 01:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328588; cv=none; b=WtwtqCz6P/Iqp1NlnP9phnnj8AvyPQunO80D+L4oI8baqlDtLcj7VEil5qAKK9QKAaXaiqSo6aB2vXwnQc5MvIVoogOZRJJ+W628P41dsnUHdABShQpTzQZeyK4kglwZKkaqq1rrMxiWdjEgHNwzIPlYWkFD+IjRkgAY4UbhZtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328588; c=relaxed/simple; bh=IrY0eGxSChiRY4Cxlu1YtDyRdH9huQg1/FmQrUI6izs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tZw9FfVicyMEYUxm0D3BJMc1qnn9gT2/we87MZuSTk3ht6ubXUj3JRpch1FJjQgO8Aeah6PD7VsL6vjNwsRzps2z81p+Yy+ZM9fN3Bbs4EvD05Kufh1JlRS5M7q4q9ms2k0swWIwIXLRE/u3FlILpb7iTfNrK0jDBLtmtTOzqR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gg/NBiRm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gg/NBiRm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62153C19421; Sun, 1 Mar 2026 01:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772328587; bh=IrY0eGxSChiRY4Cxlu1YtDyRdH9huQg1/FmQrUI6izs=; h=From:To:Cc:Subject:Date:From; b=Gg/NBiRmo9mYR8tQ+OxxH5Kjy3TK1eYCTEgVG0bLv7BZIthzThvP4gDKzLB7KHq+S B4uwtNd1fNc+bGjJfzoZ0IQT6s03oVyx/MkQdpRMYr7NpULxV1WNvuKCDwGpOQXhVM eJpwfVCpMcAM99knDvx4TFmi8VA2XSbLkCPtDQyTQWaWtemRBNkZmCn3wo1gw7R6hB HVQLetx0BmNn9k6ABQHtsV8JpGvpN5RSTl+FOPPAGDuVz2anR4tAnIoUej7ZKf1kJA HWaeOnLaKIgUh/GBCYutWCSrc77+oHxPqWwX+wMdm7AG1lRIFdzB5BfOCkSICCDgQM nL0/AbdNGWeEA== From: Sasha Levin To: stable@vger.kernel.org, petr.pavlu@suse.com Cc: Mathieu Desnoyers , Tom Zanussi , "Masami Hiramatsu (Google)" , "Steven Rostedt (Google)" , linux-trace-kernel@vger.kernel.org Subject: FAILED: Patch "tracing: Fix checking of freed trace_event_file for hist files" failed to apply to 6.12-stable tree Date: Sat, 28 Feb 2026 20:29:44 -0500 Message-ID: <20260301012945.1687606-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From f0a0da1f907e8488826d91c465f7967a56a95aca Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Thu, 19 Feb 2026 17:27:01 +0100 Subject: [PATCH] tracing: Fix checking of freed trace_event_file for hist files The event_hist_open() and event_hist_poll() functions currently retrieve a trace_event_file pointer from a file struct by invoking event_file_data(), which simply returns file->f_inode->i_private. The functions then check if the pointer is NULL to determine whether the event is still valid. This approach is flawed because i_private is assigned when an eventfs inode is allocated and remains set throughout its lifetime. Instead, the code should call event_file_file(), which checks for EVENT_FILE_FL_FREED. Using the incorrect access function may result in the code potentially opening a hist file for an event that is being removed or becoming stuck while polling on this file. Correct the access method to event_file_file() in both functions. Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Cc: Tom Zanussi Link: https://patch.msgid.link/20260219162737.314231-2-petr.pavlu@suse.com Fixes: 1bd13edbbed6 ("tracing/hist: Add poll(POLLIN) support on hist file") Signed-off-by: Petr Pavlu Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_hist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index e6f449f53afcc..768df987419e3 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -5784,7 +5784,7 @@ static __poll_t event_hist_poll(struct file *file, struct poll_table_struct *wai guard(mutex)(&event_mutex); - event_file = event_file_data(file); + event_file = event_file_file(file); if (!event_file) return EPOLLERR; @@ -5822,7 +5822,7 @@ static int event_hist_open(struct inode *inode, struct file *file) guard(mutex)(&event_mutex); - event_file = event_file_data(file); + event_file = event_file_file(file); if (!event_file) { ret = -ENODEV; goto err; -- 2.51.0