Re: [BUG RESEND] [BISECTED]: selftest: ftracetest: memleak in vfs_write()

From: Steven Rostedt
Date: Tue Apr 04 2023 - 18:24:37 EST


On Tue, 4 Apr 2023 15:07:44 -0700
Eric Biggers <ebiggers@xxxxxxxxxx> wrote:

> This looks like an issue with the tracing subsystem. I appreciate that you've
> now added the tracing maintainers to Cc. I don't think your bisection to commit
> 71946a25f357 ("Merge tag 'mmc-v6.2' ...") is correct; that looks unrelated.

No that is not the correct commit. I think I see the issue. The error log
of a tracing instance doesn't seem to be freed if the instance is removed.

I'm guessing this can cause the bug:

# cd /sys/kernel/tracincg
# mkdir instances/foo
# echo 'p:nothing no_function_here' > instances/foo/dynamic_events
# rmdir instances/foo

I haven't tried the above commands so there may be a syntax error, but I
bet that would cause the issue. Basically, you need to create an instance,
cause a syntax error in creating something (which will add to the error log
list that shows the error), and then delete the instance.

I don't see where it would clean up the error log in that case, and it
would get leaked.

I'll write up a patch to fix this today (after confirming that does indeed
cause a leak).

-- Steve