Re: [GIT PULL] tracing: Fixes for v6.17

From: Nathan Chancellor
Date: Fri Aug 22 2025 - 19:55:54 EST


On Fri, Aug 22, 2025 at 05:39:59PM -0400, Steven Rostedt wrote:
> On Fri, 22 Aug 2025 14:23:11 -0700
> Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> > > Actually, can you see if this fixes the bug you are seeing?
> >
> > Yes, it does.
> >
> > Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
>
> Ah, that patch isn't good, as iter->hash must be non NULL going forward,
> otherwise it thinks it failed to allocated.
>
> Could you test this one instead?

Yes, this one works as well for that test.

> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index f992a5eb878e..a69067367c29 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -4662,7 +4662,10 @@ ftrace_regex_open(struct ftrace_ops *ops, int flag,
> iter->hash = alloc_and_copy_ftrace_hash(size_bits, hash);
> }
> } else {
> - iter->hash = alloc_and_copy_ftrace_hash(hash->size_bits, hash);
> + if (hash)
> + iter->hash = alloc_and_copy_ftrace_hash(hash->size_bits, hash);
> + else
> + iter->hash = EMPTY_HASH;
> }
>
> if (!iter->hash) {
>
>
> Thanks,
>
> -- Steve