mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: [GIT PULL] tracing: Fixes for v6.16
Date: Fri, 13 Jun 2025 11:49:42 -0400	[thread overview]
Message-ID: <20250613114942.61ee3dc5@batman.local.home> (raw)



Linus,

tracing fix for 6.16:

- Do not free "head" variable in filter_free_subsystem_filters()

  The first error path jumps to "free_now" label but first frees the newly
  allocated "head" variable. But the "free_now" code checks this variable,
  and if it is not NULL, it will iterate the list. As this list variable
  was already initialized, the "free_now" code will not do anything as it
  is empty. But freeing it will cause a UAF bug. The error path should
  simply jump to the "free_now" label and leave the "head" variable alone.


Please pull the latest trace-v6.16-rc1 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.16-rc1

Tag SHA1: 3dec58ebef0af8431ecffae2b1814a11b86dbde1
Head SHA1: 8a157d8a00e815cab4432653cb50c9cedbbb4931


Steven Rostedt (1):
      tracing: Do not free "head" on error path of filter_free_subsystem_filters()

----
 kernel/trace/trace_events_filter.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---------------------------
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index ea8b364b6818..08141f105c95 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1437,10 +1437,8 @@ static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,
 	INIT_LIST_HEAD(&head->list);
 
 	item = kmalloc(sizeof(*item), GFP_KERNEL);
-	if (!item) {
-		kfree(head);
+	if (!item)
 		goto free_now;
-	}
 
 	item->filter = filter;
 	list_add_tail(&item->list, &head->list);

             reply	other threads:[~2025-06-13 15:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 15:49 Steven Rostedt [this message]
2025-06-13 17:05 ` Linus Torvalds
2025-06-13 17:11   ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2025-06-28 13:49 Steven Rostedt
2025-06-28 22:20 ` pr-tracker-bot
2025-06-03 19:59 Steven Rostedt
2025-06-03 23:21 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250613114942.61ee3dc5@batman.local.home \
    --to=rostedt@goodmis.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®