Re: [PATCH 2/2] tracing: hist: undo the registration when enabling the trigger fails
From: Donggeun Yoo
Date: Mon Sep 07 2026 - 09:24:26 EST
On Mon, Sep 07, 2026 at 01:01:05PM +0000, sashiko-bot@xxxxxxxxxx wrote:
> [Severity: High]
> This is a pre-existing issue, but missing cleanup in the error path before
> this label can lead to a use-after-free on the global named_triggers list.
>
> When hist_register_trigger() fails after successfully executing
> data->cmd_ops->init(data), it returns a negative error code without undoing
> the initialization. For instance, if tracing_set_clock() fails due to an
> invalid clock name:
Same one as on patch 1, answered there:
https://lore.kernel.org/linux-trace-kernel/20260907125934.5C6261F00A3E@xxxxxxxxxxxxxxx/
It is fixed by a separate patch that moves tracing_set_clock() above the
init, which this series is not based on.