Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch: # ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com --- .../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() {
instance_set() { while :; do - echo 1 > foo/events/sched/sched_switch + echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null }
On Mon, 26 Jun 2023 08:11:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch: # ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
Good catch!
Fixes: 91e6f1ce8657 ("ftracetest: Add instance created, delete, read and enable event test")
It seems this tests internally broken but the result is same because this disabled error checking ('set +e').
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com
.../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() { instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
} -- 2.25.1
On Mon, 26 Jun 2023 19:11:14 +0900 Masami Hiramatsu (Google) mhiramat@kernel.org wrote:
On Mon, 26 Jun 2023 08:11:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch: # ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
Good catch!
Fixes: 91e6f1ce8657 ("ftracetest: Add instance created, delete, read and enable event test")
It seems this tests internally broken but the result is same because this disabled error checking ('set +e').
And
Acked-by: Masami Hiramatsu (Google) mhiramat@kernel.org
Thanks!
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com
.../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() { instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
} -- 2.25.1
-- Masami Hiramatsu (Google) mhiramat@kernel.org
Shuah, can you take this?
On Mon, 26 Jun 2023 19:12:55 +0900 Masami Hiramatsu (Google) mhiramat@kernel.org wrote:
On Mon, 26 Jun 2023 19:11:14 +0900 Masami Hiramatsu (Google) mhiramat@kernel.org wrote:
On Mon, 26 Jun 2023 08:11:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch: # ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
Good catch!
Fixes: 91e6f1ce8657 ("ftracetest: Add instance created, delete, read and enable event test")
It seems this tests internally broken but the result is same because this disabled error checking ('set +e').
And
Acked-by: Masami Hiramatsu (Google) mhiramat@kernel.org
Acked-by: Steven Rostedt (Google) rostedt@goodmis.org
-- Steve
Thanks!
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com
.../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() { instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
} -- 2.25.1
-- Masami Hiramatsu (Google) mhiramat@kernel.org
On 2023/7/11 06:37, Steven Rostedt wrote:
Shuah, can you take this?
Kindly ping and bug report :)
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/?i...
[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
On Mon, 26 Jun 2023 19:12:55 +0900 Masami Hiramatsu (Google) mhiramat@kernel.org wrote:
On Mon, 26 Jun 2023 19:11:14 +0900 Masami Hiramatsu (Google) mhiramat@kernel.org wrote:
On Mon, 26 Jun 2023 08:11:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch: # ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
Good catch!
Fixes: 91e6f1ce8657 ("ftracetest: Add instance created, delete, read and enable event test")
It seems this tests internally broken but the result is same because this disabled error checking ('set +e').
And
Acked-by: Masami Hiramatsu (Google) mhiramat@kernel.org
Acked-by: Steven Rostedt (Google) rostedt@goodmis.org
Thanks for your ack :)
-- Zheng Yejian
-- Steve
Thanks!
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com
.../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() { instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
}echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
2.25.1
-- Masami Hiramatsu (Google) mhiramat@kernel.org
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/?i...
[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
On Tue, 5 Sep 2023 12:25:00 -0400 Steven Rostedt rostedt@goodmis.org wrote:
I wonder if this is related to:
https://lore.kernel.org/all/202309050916.58201dc6-oliver.sang@intel.com/
Which I'm currently debugging.
I just noticed that the config supplied with that had LOCKDOWN enabled, which I never tested, so this is not the same bug.
-- Steve
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")
Can you send me your config?
-- Steve
On Tue, 5 Sep 2023 14:45:52 -0400 Steven Rostedt rostedt@goodmis.org wrote:
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")
Can you send me your config?
Never mind, I triggered it. I believe I see the bug.
-- Steve
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/?i...
Hi Zheng,
Can you test:
https://lore.kernel.org/all/20230905183332.628d7cc0@gandalf.local.home/
and see if it fixes the KASAN issue for you?
Thanks!
-- Steve
On 2023/9/6 06:36, Steven Rostedt wrote:
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/?i...
Hi Zheng,
Can you test:
https://lore.kernel.org/all/20230905183332.628d7cc0@gandalf.local.home/
and see if it fixes the KASAN issue for you?
Hi, Steve, your new patch seems not fixes the KASAN issue.
I run the instance-event.tc with your patch again and get same KASAN report.
My config is in:
https://lore.kernel.org/all/da5495b5-cdb5-cb82-dd9b-37e7a87ed97d@huawei.com/
Thanks!
-- Steve
On Wed, 6 Sep 2023 09:42:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Hi, Steve, your new patch seems not fixes the KASAN issue.
I run the instance-event.tc with your patch again and get same KASAN report.
My config is in: https://lore.kernel.org/all/da5495b5-cdb5-cb82-dd9b-37e7a87ed97d@huawei.com/
I'm not able to reproduce it.
Can you send me the full dmesg.
Thanks,
-- Steve
On 2023/9/6 19:27, Steven Rostedt wrote:
On Wed, 6 Sep 2023 09:42:44 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Hi, Steve, your new patch seems not fixes the KASAN issue.
I run the instance-event.tc with your patch again and get same KASAN report.
My config is in: https://lore.kernel.org/all/da5495b5-cdb5-cb82-dd9b-37e7a87ed97d@huawei.com/
I'm not able to reproduce it.
Can you send me the full dmesg.
Hi, Steve,
can you receive the attachments? dmesg log is too long, so I put them in attachment file:
dmesg before the patch see attachment "dmesg_before_patch" https://lore.kernel.org/all/20230905183332.628d7cc0@gandalf.local.home/ and dmesg after above patch see attachment "dmesg_after_patch".
BTW, I do reproduce with following testcase fix, then just run: ./ftracetest test.d/instances/instance-event.tc diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() {
instance_set() { while :; do - echo 1 > foo/events/sched/sched_switch + echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null }
--
Thanks, Zheng Yejian
Thanks,
-- Steve
On Wed, 6 Sep 2023 19:57:24 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
BTW, I do reproduce with following testcase fix, then just run: ./ftracetest test.d/instances/instance-event.tc diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() {
instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
}echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
Ah thanks. I didn't have that on my test box :-p
Although I'm still having issues reproducing it. Do you have anything special on your kernel command line?
-- Steve
On Wed, 6 Sep 2023 08:56:21 -0400 Steven Rostedt rostedt@goodmis.org wrote:
On Wed, 6 Sep 2023 19:57:24 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
BTW, I do reproduce with following testcase fix, then just run: ./ftracetest test.d/instances/instance-event.tc diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() {
instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
}echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
Ah thanks. I didn't have that on my test box :-p
Although I'm still having issues reproducing it. Do you have anything special on your kernel command line?
Also, which branch are you testing? What's the sha of the code you are testing?
-- Steve
On 2023/9/6 21:02, Steven Rostedt wrote:
On Wed, 6 Sep 2023 08:56:21 -0400 Steven Rostedt rostedt@goodmis.org wrote:
On Wed, 6 Sep 2023 19:57:24 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
BTW, I do reproduce with following testcase fix, then just run: ./ftracetest test.d/instances/instance-event.tc diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc index 0eb47fbb3f44..42422e425107 100644 --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc @@ -39,7 +39,7 @@ instance_read() {
instance_set() { while :; do
echo 1 > foo/events/sched/sched_switch
}echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null
Ah thanks. I didn't have that on my test box :-p
Although I'm still having issues reproducing it. Do you have anything special on your kernel command line?
I can reproduce it on qemu, boot command seems nothing special (replace ${kernel} with bzImage path and replace ${rootfs} with a ubuntu image):
qemu-system-x86_64 -M pc -m 8G -enable-kvm -smp cpus=12 -kernel ${kernel} -drive file=${rootfs},if=virtio,format=raw,id=hd0 -fsdev local,security_model=passthrough,id=fsdev0,path=/home/test -nographic -append "rootwait root=/dev/vda rw console=ttyS0 rodata=off"
Also, which branch are you testing? What's the sha of the code you are testing?
I think it can be reproduced after any commit after commit 27152bceea1d ("eventfs: Move tracing/events to eventfs")
also can be reproduced with the newest: 65d6e954e378 ("Merge tag 'gfs2-v6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2")
And revert commit 27152bceea1d ("eventfs: Move tracing/events to eventfs"), the issue just seems gone.
--
Thanks, Zheng Yejian
-- Steve
On Wed, 6 Sep 2023 21:31:32 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Also, which branch are you testing? What's the sha of the code you are testing?
I think it can be reproduced after any commit after commit 27152bceea1d ("eventfs: Move tracing/events to eventfs")
also can be reproduced with the newest: 65d6e954e378 ("Merge tag 'gfs2-v6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2")
And revert commit 27152bceea1d ("eventfs: Move tracing/events to eventfs"), the issue just seems gone.
The reason I'm asking is that there could be something added that fixes it. I'm testing Linus's tree at: cbb557ba92f08b945e2cb20b7ab37ef49ab53cdd
Can you add the patch to that and see if you can still reproduce it?
-- Steve
On Wed, 6 Sep 2023 09:43:06 -0400 Steven Rostedt rostedt@goodmis.org wrote:
also can be reproduced with the newest: 65d6e954e378 ("Merge tag 'gfs2-v6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2")
And revert commit 27152bceea1d ("eventfs: Move tracing/events to eventfs"), the issue just seems gone.
The reason I'm asking is that there could be something added that fixes it. I'm testing Linus's tree at: cbb557ba92f08b945e2cb20b7ab37ef49ab53cdd
Never mind, I just noticed that your above sha includes this one.
Not sure why I can't reproduce this. I'm using qemu as well.
-- Steve
On 2023/9/6 21:45, Steven Rostedt wrote:
On Wed, 6 Sep 2023 09:43:06 -0400 Steven Rostedt rostedt@goodmis.org wrote:
also can be reproduced with the newest: 65d6e954e378 ("Merge tag 'gfs2-v6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2")
And revert commit 27152bceea1d ("eventfs: Move tracing/events to eventfs"), the issue just seems gone.
The reason I'm asking is that there could be something added that fixes it. I'm testing Linus's tree at: cbb557ba92f08b945e2cb20b7ab37ef49ab53cdd
Never mind, I just noticed that your above sha includes this one.
Not sure why I can't reproduce this. I'm using qemu as well.
Will the qemu version have an impact? Mine is:
$ qemu-system-x86_64 --version QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.27) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
--
Thanks, Zheng Yejian
-- Steve
On Wed, 6 Sep 2023 22:01:35 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Will the qemu version have an impact? Mine is:
It shouldn't, but...
$ qemu-system-x86_64 --version QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.27) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
I'm using:
$ qemu-system-x86_64 --version QEMU emulator version 8.0.3 (Debian 1:8.0.3+dfsg-5) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
Maybe it's just that yours causes the race window to be bigger.
-- Steve
On 9/5/23 06:54, Zheng Yejian wrote:
On 2023/7/11 06:37, Steven Rostedt wrote:
Shuah, can you take this?
Kindly ping and bug report :)
I am sorry for the delay. Looks this one got buried deep when I was away on vacation.
Applied now for my next Linux 6.6 update.
thanks, -- Shuah
On 2023/9/6 06:43, Shuah Khan wrote:
On 9/5/23 06:54, Zheng Yejian wrote:
On 2023/7/11 06:37, Steven Rostedt wrote:
Shuah, can you take this?
Kindly ping and bug report :)
I am sorry for the delay. Looks this one got buried deep when I was away on vacation.
Applied now for my next Linux 6.6 update.
Thanks!
-- Zheng Yejian
thanks, -- Shuah
[my two cents]
I do see similar kernel panic while running ftrace testing on today's Linux next-20230906 tag. This crash is from qemu-arm64.
Here I am providing steps to reproduced link and scripts by using tuxrun tool. - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2V0OqxEZUXI...
Script details, ============= # To install tuxrun to your home directory at ~/.local/bin: # pip3 install -U --user tuxrun==0.49.0 # # Or install a deb/rpm depending on the running distribution # See https://tuxmake.org/install-deb/ or # https://tuxmake.org/install-rpm/ # # See https://tuxrun.org/ for complete documentation. # #
tuxrun --runtime podman --device qemu-arm64 --boot-args rw --kernel https://storage.tuxsuite.com/public/linaro/lkft/builds/2V0OpMYBZhVvxapElfcyF... --modules https://storage.tuxsuite.com/public/linaro/lkft/builds/2V0OpMYBZhVvxapElfcyF... --rootfs https://storage.tuxboot.com/debian/bookworm/arm64/rootfs.ext4.xz --parameters SKIPFILE=skipfile-lkft.yaml --parameters KSELFTEST=https://storage.tuxsuite.com/public/linaro/lkft/builds/2V0OpMYBZhVvxapElfcyF... --image docker.io/linaro/tuxrun-dispatcher:v0.49.0 --tests kselftest-ftrace --timeouts boot=30 kselftest-ftrace=40
Log details, ------------- # ok 45 ftrace - test tracing error log support <47>[ 1373.662292] systemd-journald[90]: Sent WATCHDOG=1 notification. # ok 46 Test creation and deletion of trace instances while setting an event <1>[ 1382.873224] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 <1>[ 1382.873223] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 <1>[ 1382.873426] Mem abort info: <1>[ 1382.874414] Mem abort info: <1>[ 1382.874449] ESR = 0x0000000097820004 <1>[ 1382.876291] ESR = 0x0000000097820004 <1>[ 1382.876385] EC = 0x25: DABT (current EL), IL = 32 bits <1>[ 1382.877319] SET = 0, FnV = 0 <1>[ 1382.877370] EA = 0, S1PTW = 0 <1>[ 1382.878795] EC = 0x25: DABT (current EL), IL = 32 bits <1>[ 1382.879182] SET = 0, FnV = 0 <1>[ 1382.879447] EA = 0, S1PTW = 0 <1>[ 1382.879729] FSC = 0x04: level 0 translation fault <1>[ 1382.879967] Data abort info: <1>[ 1382.880240] Access size = 4 byte(s) <1>[ 1382.880562] SSE = 0, SRT = 2 <1>[ 1382.880849] SF = 0, AR = 0 <1>[ 1382.881071] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 <1>[ 1382.881442] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 <1>[ 1382.881934] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000109bd6000 <1>[ 1382.882268] [0000000000000030] pgd=0000000000000000, p4d=0000000000000000 <0>[ 1382.883777] Internal error: Oops: 0000000097820004 [#1] PREEMPT SMP <4>[ 1382.884325] Modules linked in: crct10dif_ce sm3_ce sm3 sha3_ce sha512_ce sha512_arm64 fuse drm backlight dm_mod ip_tables x_tables [last unloaded: trace_printk] <4>[ 1382.886127] CPU: 1 PID: 3241 Comm: ls Not tainted 6.5.0-next-20230906 #1 <1>[ 1382.886539] FSC = 0x04: level 0 translation fault <1>[ 1382.891731] Data abort info: <1>[ 1382.891995] Access size = 4 byte(s) <1>[ 1382.892315] SSE = 0, SRT = 2 <1>[ 1382.892603] SF = 0, AR = 0 <1>[ 1382.892878] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 <1>[ 1382.893291] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 <1>[ 1382.893719] user pgtable: 4k pages, 48-bit VAs, pgdp=000000010962a000 <1>[ 1382.894229] [0000000000000030] pgd=0000000000000000, p4d=0000000000000000 <4>[ 1382.897391] Hardware name: linux,dummy-virt (DT) <4>[ 1382.898217] pstate: 824000c9 (Nzcv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--) <4>[ 1382.899653] pc : trace_event_buffer_reserve+0x78/0xc0 <4>[ 1382.900902] lr : trace_event_buffer_reserve+0x60/0xc0 <4>[ 1382.902127] sp : ffff800080e43ac0 <4>[ 1382.903181] x29: ffff800080e43ac0 x28: ffff0000c5833348 x27: 0000000000000001 <4>[ 1382.904708] x26: 0000000000000000 x25: 0000000000000000 x24: ffff0000c5832dc0 <4>[ 1382.906141] x23: ffff0000c5834c40 x22: 0000000000000000 x21: 0000000000000040 <4>[ 1382.907736] x20: ffff0000c8ff6a20 x19: ffff800080e43b38 x18: 0000000000000000 <4>[ 1382.909777] x17: ffff5068c5eb0000 x16: ffff800080008000 x15: 00001e8480000000 <4>[ 1382.910696] x14: 000000000003d090 x13: 0000000000000000 x12: 000010a6a8ef4568 <4>[ 1382.912214] x11: 0042c616304c5adc x10: 000000000000b67e x9 : ffffaf98378ee6f8 <4>[ 1382.913698] x8 : 01fd405aa4bf7a00 x7 : 0000000000000009 x6 : 0000000000000081 <4>[ 1382.915755] x5 : 000000000000000f x4 : 0000000000010002 x3 : 0000000000000040 <4>[ 1382.916645] x2 : 0000000000000003 x1 : ffff0000c8ff6a20 x0 : ffff800080e43b38 <4>[ 1382.918912] Call trace: <4>[ 1382.919358] trace_event_buffer_reserve+0x78/0xc0 <4>[ 1382.920703] trace_event_raw_event_sched_switch+0x68/0x158 <4>[ 1382.922509] __schedule+0x5ac/0xb38 <4>[ 1382.923027] preempt_schedule_irq+0x44/0xa8 <4>[ 1382.924169] el1_interrupt+0x4c/0x68 <4>[ 1382.925259] el1h_64_irq_handler+0x18/0x28 <4>[ 1382.926943] el1h_64_irq+0x64/0x68 <4>[ 1382.927415] iterate_dir+0x0/0x198 <4>[ 1382.928505] invoke_syscall+0x50/0x120 <4>[ 1382.930141] el0_svc_common.constprop.0+0x48/0xf0 <4>[ 1382.930761] do_el0_svc+0x24/0x38 <4>[ 1382.931907] el0_svc+0x48/0xf8 <4>[ 1382.932906] el0t_64_sync_handler+0x120/0x130 <4>[ 1382.934044] el0t_64_sync+0x190/0x198 <0>[ 1382.936061] Code: b9002264 aa1503e3 aa1403e1 aa1303e0 (b94032c2) <4>[ 1382.937767] ---[ end trace 0000000000000000 ]--- <0>[ 1382.939168] Internal error: Oops: 0000000097820004 [#2] PREEMPT SMP <6>[ 1382.939221] note: ls[3241] exited with irqs disabled <4>[ 1382.939699] Modules linked in: crct10dif_ce sm3_ce sm3 sha3_ce sha512_ce sha512_arm64 fuse drm backlight dm_mod ip_tables x_tables [last unloaded: trace_printk] <4>[ 1382.940174] CPU: 0 PID: 3233 Comm: mkdir Tainted: G D 6.5.0-next-20230906 #1 <4>[ 1382.940237] Hardware name: linux,dummy-virt (DT) <4>[ 1382.940267] pstate: 824000c9 (Nzcv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--) <4>[ 1382.940310] pc : trace_event_buffer_reserve+0x78/0xc0 <4>[ 1382.944728] lr : trace_event_buffer_reserve+0x60/0xc0 <4>[ 1382.945364] sp : ffff800080ddb800 <4>[ 1382.946351] x29: ffff800080ddb800 x28: ffff0000c2444288 x27: 0000000000000001 <4>[ 1382.947882] x26: 0000000000000000 x25: ffffaf9838b57e00 x24: ffff0000c2443d00 <4>[ 1382.949375] x23: ffff0000c02ceac0 x22: 0000000000000000 x21: 0000000000000040 <4>[ 1382.951442] x20: ffff0000c8ff6a20 x19: ffff800080ddb878 x18: ffff800080e3bc48 <4>[ 1382.952347] x17: ffff5068c5e91000 x16: ffff800080000000 x15: 000000000000000c <4>[ 1382.954391] x14: 0000000000000001 x13: 006b7361745f6465 x12: 00000e73fb208dc2 <4>[ 1382.955303] x11: 0039fa6a50d119f8 x10: 000000000000b67e x9 : ffffaf98378ee6f8 <4>[ 1382.956810] x8 : ffff0000ff7b1400 x7 : 0000000000000009 x6 : 0000000000000081 <4>[ 1382.958316] x5 : 000000000000000f x4 : 0000000000010002 x3 : 0000000000000040 <4>[ 1382.959846] x2 : 0000000000000003 x1 : ffff0000c8ff6a20 x0 : ffff800080ddb878 <4>[ 1382.961396] Call trace: <4>[ 1382.962391] trace_event_buffer_reserve+0x78/0xc0 <4>[ 1382.963637] trace_event_raw_event_sched_switch+0x68/0x158 <4>[ 1382.964913] __schedule+0x5ac/0xb38 <4>[ 1382.966018] preempt_schedule_irq+0x44/0xa8 <4>[ 1382.967055] el1_interrupt+0x4c/0x68 <4>[ 1382.967816] el1h_64_irq_handler+0x18/0x28 <4>[ 1382.968607] el1h_64_irq+0x64/0x68 <4>[ 1382.969353] __kmalloc_node_track_caller+0x0/0x1b8 <4>[ 1382.970204] eventfs_prepare_ef.constprop.0+0x5c/0xf0 <4>[ 1382.971094] eventfs_add_file+0x38/0xb0 <4>[ 1382.971872] event_create_dir+0x120/0x4b0 <4>[ 1382.972751] event_trace_add_tracer+0xac/0x120 <4>[ 1382.973564] trace_array_create_dir+0x3c/0xc8 <4>[ 1382.974382] trace_array_create+0x11c/0x1e8 <4>[ 1382.975221] instance_mkdir+0x78/0xb8 <4>[ 1382.975987] tracefs_syscall_mkdir+0x50/0x90 <4>[ 1382.976798] vfs_mkdir+0x198/0x230 <4>[ 1382.977549] do_mkdirat+0x9c/0x168 <4>[ 1382.978289] __arm64_sys_mkdirat+0x58/0x90 <4>[ 1382.979106] invoke_syscall+0x50/0x120 <4>[ 1382.979893] el0_svc_common.constprop.0+0x48/0xf0 <4>[ 1382.980735] do_el0_svc+0x24/0x38 <4>[ 1382.981475] el0_svc+0x48/0xf8 <4>[ 1382.982194] el0t_64_sync_handler+0x120/0x130 <4>[ 1382.983021] el0t_64_sync+0x190/0x198 <0>[ 1382.983830] Code: b9002264 aa1503e3 aa1403e1 aa1303e0 (b94032c2) <4>[ 1382.984710] ---[ end trace 0000000000000000 ]--- <6>[ 1382.985490] note: mkdir[3233] exited with irqs disabled
Links: - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230906/tes... - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230906/tes... - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2V0OqxEZUXI...
-- Linaro LKFT https://lkft.linaro.org
On Wed, 6 Sep 2023 19:56:52 +0530 Naresh Kamboju naresh.kamboju@linaro.org wrote:
[my two cents]
I do see similar kernel panic while running ftrace testing on today's Linux next-20230906 tag. This crash is from qemu-arm64.
Here I am providing steps to reproduced link and scripts by using tuxrun tool.
[..]
Log details,
# ok 45 ftrace - test tracing error log support <47>[ 1373.662292] systemd-journald[90]: Sent WATCHDOG=1 notification. # ok 46 Test creation and deletion of trace instances while setting an event
It's definitely a race with the creation and deletion of instances.
I'm going to run it on my laptop VM and see if that reproduces it. My other VM is on a pretty powerful machine, and perhaps that's keeping it from hitting the race.
-- Steve
<1>[ 1382.873224] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 <1>[ 1382.873223] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 <1>[ 1382.873426] Mem abort info:
On Wed, 6 Sep 2023 10:37:18 -0400 Steven Rostedt rostedt@goodmis.org wrote:
Log details,
# ok 45 ftrace - test tracing error log support <47>[ 1373.662292] systemd-journald[90]: Sent WATCHDOG=1 notification. # ok 46 Test creation and deletion of trace instances while setting an event
It's definitely a race with the creation and deletion of instances.
I'm going to run it on my laptop VM and see if that reproduces it. My other VM is on a pretty powerful machine, and perhaps that's keeping it from hitting the race.
Putting in a while loop of:
# while :; do ./ftracetest test.d/instances/instance-event.tc ; done
eventually triggered the bug. Looks like this is really an existing bug not related to the eventfs, but the eventfs code actually opened up the window of this race.
Hopefully I'll have a fix shortly.
-- Steve
On 2023/9/7 05:37, Steven Rostedt wrote:
On Wed, 6 Sep 2023 10:37:18 -0400 Steven Rostedt rostedt@goodmis.org wrote:
Log details,
# ok 45 ftrace - test tracing error log support <47>[ 1373.662292] systemd-journald[90]: Sent WATCHDOG=1 notification. # ok 46 Test creation and deletion of trace instances while setting an event
It's definitely a race with the creation and deletion of instances.
I'm going to run it on my laptop VM and see if that reproduces it. My other VM is on a pretty powerful machine, and perhaps that's keeping it from hitting the race.
Putting in a while loop of:
# while :; do ./ftracetest test.d/instances/instance-event.tc ; done
In test.d/instances/instance-event.tc, concurrently create/delete/access intances just about 1 second and then killed them, it may cause missing the race.
No longer sleep and kill, following testcase can also reproduce: ``` #!/bin/bash
cd /sys/kernel/tracing/instances
instance_slam() { while :; do mkdir foo 2> /dev/null rmdir foo 2> /dev/null done }
instance_set() { while :; do echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null }
instance_slam & p1=$! echo $p1
instance_set & p2=$! echo $p2 ```
--
Thanks, Zheng Yejian
eventually triggered the bug. Looks like this is really an existing bug not related to the eventfs, but the eventfs code actually opened up the window of this race.
Hopefully I'll have a fix shortly.
-- Steve
On Wed, 6 Sep 2023 19:56:52 +0530 Naresh Kamboju naresh.kamboju@linaro.org wrote:
[my two cents]
I do see similar kernel panic while running ftrace testing on today's Linux next-20230906 tag. This crash is from qemu-arm64.
Here I am providing steps to reproduced link and scripts by using tuxrun tool.
Script details, ============= # To install tuxrun to your home directory at ~/.local/bin: # pip3 install -U --user tuxrun==0.49.0 # # Or install a deb/rpm depending on the running distribution # See https://tuxmake.org/install-deb/ or # https://tuxmake.org/install-rpm/ # # See https://tuxrun.org/ for complete documentation. # #
BTW, when you ran these, did you apply:
https://patchwork.kernel.org/project/linux-trace-kernel/patch/20230905183332...
?
-- Steve
On Wed, 6 Sep 2023 14:50:00 -0400 Steven Rostedt rostedt@goodmis.org wrote:
BTW, when you ran these, did you apply:
https://patchwork.kernel.org/project/linux-trace-kernel/patch/20230905183332...
Can you both try the above patch and this patch?
-- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 35783a7baf15..0827037ee3b8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4973,6 +4973,33 @@ int tracing_open_generic_tr(struct inode *inode, struct file *filp) return 0; }
+/* + * The private pointer of the inode is the trace_event_file. + * Update the tr ref count associated to it. + */ +int tracing_open_file_tr(struct inode *inode, struct file *filp) +{ + struct trace_event_file *file = inode->i_private; + int ret; + + ret = tracing_check_open_get_tr(file->tr); + if (ret) + return ret; + + filp->private_data = inode->i_private; + + return 0; +} + +int tracing_release_file_tr(struct inode *inode, struct file *filp) +{ + struct trace_event_file *file = inode->i_private; + + trace_array_put(file->tr); + + return 0; +} + static int tracing_mark_open(struct inode *inode, struct file *filp) { stream_open(inode, filp); diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 5669dd1f90d9..77debe53f07c 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -610,6 +610,8 @@ void tracing_reset_all_online_cpus(void); void tracing_reset_all_online_cpus_unlocked(void); int tracing_open_generic(struct inode *inode, struct file *filp); int tracing_open_generic_tr(struct inode *inode, struct file *filp); +int tracing_open_file_tr(struct inode *inode, struct file *filp); +int tracing_release_file_tr(struct inode *inode, struct file *filp); bool tracing_is_disabled(void); bool tracer_tracing_is_on(struct trace_array *tr); void tracer_tracing_on(struct trace_array *tr); diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index ed367d713be0..2af92177b765 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2103,9 +2103,10 @@ static const struct file_operations ftrace_set_event_notrace_pid_fops = { };
static const struct file_operations ftrace_enable_fops = { - .open = tracing_open_generic, + .open = tracing_open_file_tr, .read = event_enable_read, .write = event_enable_write, + .release = tracing_release_file_tr, .llseek = default_llseek, };
@@ -2122,9 +2123,10 @@ static const struct file_operations ftrace_event_id_fops = { };
static const struct file_operations ftrace_event_filter_fops = { - .open = tracing_open_generic, + .open = tracing_open_file_tr, .read = event_filter_read, .write = event_filter_write, + .release = tracing_release_file_tr, .llseek = default_llseek, };
On 2023/9/7 06:46, Steven Rostedt wrote:
On Wed, 6 Sep 2023 14:50:00 -0400 Steven Rostedt rostedt@goodmis.org wrote:
BTW, when you ran these, did you apply:
https://patchwork.kernel.org/project/linux-trace-kernel/patch/20230905183332...
Can you both try the above patch and this patch?
-- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
Hi, Steve
Only apply this new patch, the kasan issue seems gone.
--
Thanks, Zheng Yejian
index 35783a7baf15..0827037ee3b8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4973,6 +4973,33 @@ int tracing_open_generic_tr(struct inode *inode, struct file *filp) return 0; } +/*
- The private pointer of the inode is the trace_event_file.
- Update the tr ref count associated to it.
- */
+int tracing_open_file_tr(struct inode *inode, struct file *filp) +{
- struct trace_event_file *file = inode->i_private;
- int ret;
- ret = tracing_check_open_get_tr(file->tr);
- if (ret)
return ret;
- filp->private_data = inode->i_private;
- return 0;
+}
+int tracing_release_file_tr(struct inode *inode, struct file *filp) +{
- struct trace_event_file *file = inode->i_private;
- trace_array_put(file->tr);
- return 0;
+}
- static int tracing_mark_open(struct inode *inode, struct file *filp) { stream_open(inode, filp);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 5669dd1f90d9..77debe53f07c 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -610,6 +610,8 @@ void tracing_reset_all_online_cpus(void); void tracing_reset_all_online_cpus_unlocked(void); int tracing_open_generic(struct inode *inode, struct file *filp); int tracing_open_generic_tr(struct inode *inode, struct file *filp); +int tracing_open_file_tr(struct inode *inode, struct file *filp); +int tracing_release_file_tr(struct inode *inode, struct file *filp); bool tracing_is_disabled(void); bool tracer_tracing_is_on(struct trace_array *tr); void tracer_tracing_on(struct trace_array *tr); diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index ed367d713be0..2af92177b765 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2103,9 +2103,10 @@ static const struct file_operations ftrace_set_event_notrace_pid_fops = { }; static const struct file_operations ftrace_enable_fops = {
- .open = tracing_open_generic,
- .open = tracing_open_file_tr, .read = event_enable_read, .write = event_enable_write,
- .release = tracing_release_file_tr, .llseek = default_llseek, };
@@ -2122,9 +2123,10 @@ static const struct file_operations ftrace_event_id_fops = { }; static const struct file_operations ftrace_event_filter_fops = {
- .open = tracing_open_generic,
- .open = tracing_open_file_tr, .read = event_filter_read, .write = event_filter_write,
- .release = tracing_release_file_tr, .llseek = default_llseek, };
On Thu, 7 Sep 2023 09:39:56 +0800 Zheng Yejian zhengyejian1@huawei.com wrote:
Hi, Steve
Only apply this new patch, the kasan issue seems gone.
I believe the other patch is required too, as the KASAN I hit pointed directly at that.
-- Steve
linux-kselftest-mirror@lists.linaro.org