All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Alexander Konyukhov <Alexander.Konyukhov@kaspersky.com>
Cc: <mhiramat@kernel.org>, <linux-kernel@vger.kernel.org>,
	<lvc-project@linuxtesting.org>
Subject: Re: [PATCH] fix NULL dereference in event_trigger_reset_filter()
Date: Mon, 13 Jul 2026 11:38:11 -0400	[thread overview]
Message-ID: <20260713113811.19191c03@robin> (raw)
In-Reply-To: <20260713145054.2731267-1-Alexander.Konyukhov@kaspersky.com>

On Mon, 13 Jul 2026 17:50:54 +0300
Alexander Konyukhov <Alexander.Konyukhov@kaspersky.com> wrote:

> Fixes a null pointer dereference in the trace events subsystem. 
> When trigger_data_alloc() returns NULL, the original code jumps to out_free,
> invoking event_trigger_reset_filter() with a NULL pointer. 
> This propagates through set_trigger_filter() and dereferences data->filter_str 
> with data == NULL in trace_events_trigger.c.
> 
> The patch adds out_hist_data, rerouting allocation failures to skip 
> event_trigger_reset_filter() on NULL and clean up via remove_hist_vars(hist_data).
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

What kernel are you using?

> 
> Fixes: 4b147936fa50 ("tracing: Add support for 'synthetic' events")
> Signed-off-by: Alexander Konyukhov <Alexander.Konyukhov@kaspersky.com>
> ---
>  kernel/trace/trace_events_hist.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index 336fc54d8ec8..9d203ab56fac 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -6525,7 +6525,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
>  	trigger_data = trigger_data_alloc(cmd_ops, cmd, param, hist_data);
>  	if (!trigger_data) {
>  		ret = -ENOMEM;
> -		goto out_free;
> +		goto out_hist_data;
>  	}
>  
>  	ret = event_trigger_set_filter(cmd_ops, file, filter, trigger_data);
> @@ -6591,6 +6591,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
>  	event_trigger_unregister(cmd_ops, file, glob+1, trigger_data);
>   out_free:
>  	event_trigger_reset_filter(cmd_ops, trigger_data);

The above has been removed by commit a4e0ea0e10a2 ("tracing: Remove
redundant call to event_trigger_reset_filter() in event_hist_trigger_parse()")

-- Steve


> + out_hist_data:
>  
>  	remove_hist_vars(hist_data);
>  


  reply	other threads:[~2026-07-13 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 14:50 [PATCH] fix NULL dereference in event_trigger_reset_filter() Alexander Konyukhov
2026-07-13 15:38 ` Steven Rostedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-13 14:36 Alexander Konyukhov

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=20260713113811.19191c03@robin \
    --to=rostedt@goodmis.org \
    --cc=Alexander.Konyukhov@kaspersky.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.