From: Steven Rostedt <rostedt@goodmis.org>
To: Farhad Alemi <farhad.alemi@berkeley.edu>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
falemi@asu.edu, linux-trace-kernel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] tracing: use-after-free in t_start() when a trace instance is removed
Date: Thu, 27 Aug 2026 20:28:59 -0400 [thread overview]
Message-ID: <20260827202859.3573c044@fedora> (raw)
In-Reply-To: <CA+0ovCjerKZJLwXScM9bF2ga2rLi4_XOpUfK41NDbENpeu98jA@mail.gmail.com>
On Thu, 27 Aug 2026 23:05:19 +0000
Farhad Alemi <farhad.alemi@berkeley.edu> wrote:
> Hello Steven Rostedt, Masami Hiramatsu,
>
> While fuzzing Linux 7.1-rc5 with syzkaller, as part of research at ASU's
> SEFCOM lab, we hit the crash below. Crash reports can be found here:
>
> https://github.com/farhad-alemi/public_bug_reports/tree/main/116-tracing-uaf-t_start-instance-rmdir/
>
> ==================================================================
> BUG: KASAN: slab-use-after-free in t_next
> kernel/trace/trace_events.c:1568 [inline]
> BUG: KASAN: slab-use-after-free in t_start+0xcc/0x210
> kernel/trace/trace_events.c:1592
> Read of size 8 at addr ffff888022f7a960 by task syz.4.116/12466
> CPU: 0 UID: 0 PID: 12466 Comm: syz.4.116 Not tainted 7.1.0-rc5 #1
> PREEMPT(full)
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
> 1.16.3-debian-1.16.3-2 04/01/2014
> Call Trace:
> <TASK>
> dump_stack_lvl+0x94/0xd0 lib/dump_stack.c:120
>
> Our reproducer.c is available upon request.
>
> Happy to test a patch if that would help.
I see what the problem is. I guess you were creating and removing trace
instances while reading available_events. All files that are part of an
instance needs to get a reference counter on the trace instance when
opened. This prevents the instance from being freed when there are
opened files in it. I see that the available_events file doesn't take
that reference which will allow its instance to be freed while another
task has its content opened. When it reads that content, it will
trigger the bug you see.
I'll work on a fix tomorrow. I'll have to audit the event files to see
if there are any other files that are not taking a reference.
Thanks,
-- Steve
next prev parent reply other threads:[~2026-08-28 0:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 23:05 Farhad Alemi
2026-08-28 0:28 ` Steven Rostedt [this message]
2026-08-28 13:23 ` Steven Rostedt
2026-08-28 13:28 ` Steven Rostedt
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=20260827202859.3573c044@fedora \
--to=rostedt@goodmis.org \
--cc=falemi@asu.edu \
--cc=farhad.alemi@berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.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®