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 131AE13B58A; Sun, 1 Mar 2026 01:39:43 +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=1772329183; cv=none; b=ghW75sD5pofFu5Ze8ZoWdYVKRAJ6RbvgTWrk5Iy0l+62wguNbim82ydLt6Nx2suDrJgjZSh5KpKD8AW43ir8Ochku4LXYzK3rAlmkDgxGb95Y2vOVkxUdB4t4PHeyUS4NX9jxmyBOGXfH6PqvqPb3p/tOKba9joDblnjoB+KfnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329183; c=relaxed/simple; bh=3kSihd35pZHX5DwFWjx2xeQjCYzLLzdi5QrSnFGLl5I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XIea63U/PK7GJPqoryD5DmgPL3hpjNACWlGAT2Xq9Dqg4Tp1LoupYuUgHfYWCi7kBxE2KtIPxWdjExVU+bkzd8kdTpKYOib1xmvfI6ZcnQggX7fqXhZABifgg3ZPd26+57JNC505sDHP/wUF4BHwLUwWk4zwELdelz1UX6n7T7k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RujayL3a; 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="RujayL3a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26593C19421; Sun, 1 Mar 2026 01:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329182; bh=3kSihd35pZHX5DwFWjx2xeQjCYzLLzdi5QrSnFGLl5I=; h=From:To:Cc:Subject:Date:From; b=RujayL3aT2WuJW0b3TaIkH4MVJ9iH7OeNOdKFJzopkimZPjNDKSn/vHZTPRmdphvF jMZ2rzEubzRPiUvYo/2AQHs9swQ4kA9snUaeuTlxhQEs5+XrWPnZciHLV31qeDsbNi 4iaLpY9oP1GJe9q6pq/hPomCH0+BA+j3t/f+6APA9cyjSBfRLXY3WWCoWfqifXYLGo zUNMZ4M1N5jcTV9QlsdOjGd39g3XaXji2bnV71jVSlPEQS7keGYI+nxzDJV+EEZlB7 11pFciv9v8LBoJajijiyYsBwkWaxLdiWZQ1bnbX/92EeZVf10z+kAJlNhhmP9UBv8g yIYx0pMtHSCYg== 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.6-stable tree Date: Sat, 28 Feb 2026 20:39:40 -0500 Message-ID: <20260301013941.1700747-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.6-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