From: Steven Rostedt <rostedt@goodmis.org>
To: Zheng Yejian <zhengyejian1@huawei.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
Ajay Kaher <akaher@vmware.com>, <shuah@kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-trace-kernel@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
Ye Weihua <yeweihua4@huawei.com>
Subject: Re: [PATCH] selftests/ftrace: Correctly enable event in instance-event.tc
Date: Tue, 5 Sep 2023 12:25:00 -0400 [thread overview]
Message-ID: <20230905122500.700c75ec@gandalf.local.home> (raw)
In-Reply-To: <1cb3aee2-19af-c472-e265-05176fe9bd84@huawei.com>
On Tue, 5 Sep 2023 20:54:40 +0800
Zheng Yejian <zhengyejian1@huawei.com> wrote:
> Hi, Steve, Ajay,
>
> After this patch and run this testcase, I got an use-after-free report
> by KASAN. Short log see [1], full logs see attach "panic.log".
>
> And by simple bisect, I found it may be introduced by:
>
> 27152bceea1d ("eventfs: Move tracing/events to eventfs")
>
> Link:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=27152bceea1df27ffebb12ac9cd9adbf2c4c3f35
>
> [1]
> # ./ftracetest test.d/instances/instance-event.tc
> === Ftrace unit tests ===
> [1] Test creation and deletion of trace instances while setting an
> event[ 89.472397]
> ==================================================================
> [ 89.475053] BUG: KASAN: slab-use-after-free in
> __ftrace_event_enable_disable+0x1b/0x3a0
> [ 89.480039] Read of size 8 at addr ffff88814f5b2690 by task
> ftracetest/392
> [ 89.483906]
> [ 89.484560] CPU: 10 PID: 392 Comm: ftracetest Tainted: G W
> 6.5.0+ #127
> [ 89.487033] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
> BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
> [ 89.489751] Call Trace:
> [ 89.490315] <TASK>
> [ 89.490817] dump_stack_lvl+0x4b/0x80
> [ 89.491570] print_report+0xd0/0x620
> [ 89.492296] ? __virt_addr_valid+0xf9/0x180
> [ 89.493134] ? __ftrace_event_enable_disable+0x1b/0x3a0
> [ 89.494151] kasan_report+0xb6/0xf0
> [ 89.494881] ? __ftrace_event_enable_disable+0x1b/0x3a0
> [ 89.495878] __ftrace_event_enable_disable+0x1b/0x3a0
> [ 89.496805] event_enable_write+0x109/0x170
> [ 89.497631] ? __pfx_event_enable_write+0x10/0x10
> [ 89.498618] ? __pfx_bpf_lsm_file_permission+0x10/0x10
> [ 89.499659] ? security_file_permission+0x51/0x2d0
> [ 89.500604] vfs_write+0x175/0x670
> [ 89.501385] ? __pfx_vfs_write+0x10/0x10
> [ 89.502246] ? __pfx__raw_spin_lock+0x10/0x10
> [ 89.503187] ? expand_files+0x9b/0x330
> [ 89.504011] ? __pfx_expand_files+0x10/0x10
> [ 89.504898] ? set_close_on_exec+0x7b/0xe0
> [ 89.505782] ? __fget_light+0xae/0x1e0
> [ 89.506615] ? _raw_spin_lock+0x85/0xe0
> [ 89.507989] ksys_write+0xbd/0x160
> [ 89.509302] ? __pfx_ksys_write+0x10/0x10
> [ 89.510493] ? dnotify_flush+0x38/0x220
> [ 89.511654] ? fpregs_assert_state_consistent+0x5a/0x70
> [ 89.513297] ? exit_to_user_mode_prepare+0x32/0x110
> [ 89.514692] do_syscall_64+0x3f/0x90
> [ 89.515516] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
I wonder if this is related to:
https://lore.kernel.org/all/202309050916.58201dc6-oliver.sang@intel.com/
Which I'm currently debugging.
-- Steve
next prev parent reply other threads:[~2023-09-05 18:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 0:11 Zheng Yejian
2023-06-26 10:11 ` Masami Hiramatsu
2023-06-26 10:12 ` Masami Hiramatsu
2023-07-10 22:37 ` Steven Rostedt
2023-09-05 12:54 ` Zheng Yejian
2023-09-05 16:25 ` Steven Rostedt [this message]
2023-09-05 16:49 ` Steven Rostedt
2023-09-05 18:45 ` Steven Rostedt
2023-09-05 20:32 ` Steven Rostedt
2023-09-06 1:26 ` Zheng Yejian
2023-09-05 22:36 ` Steven Rostedt
2023-09-06 1:42 ` Zheng Yejian
2023-09-06 11:27 ` Steven Rostedt
2023-09-06 11:57 ` Zheng Yejian
2023-09-06 12:56 ` Steven Rostedt
2023-09-06 13:02 ` Steven Rostedt
2023-09-06 13:31 ` Zheng Yejian
2023-09-06 13:43 ` Steven Rostedt
2023-09-06 13:45 ` Steven Rostedt
2023-09-06 14:01 ` Zheng Yejian
2023-09-06 14:04 ` Steven Rostedt
2023-09-05 22:43 ` Shuah Khan
2023-09-06 1:45 ` Zheng Yejian
2023-09-06 14:26 ` "[PATCH] selftests/ftrace: Correctly enable event in instance-event.tc" Naresh Kamboju
2023-09-06 14:37 ` Steven Rostedt
2023-09-06 21:37 ` Steven Rostedt
2023-09-07 1:01 ` Zheng Yejian
2023-09-06 18:50 ` Steven Rostedt
2023-09-06 22:46 ` Steven Rostedt
2023-09-07 1:39 ` Zheng Yejian
2023-09-07 1:44 ` 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=20230905122500.700c75ec@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akaher@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=yeweihua4@huawei.com \
--cc=zhengyejian1@huawei.com \
/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®