Re: [PATCH v2 1/3] tracing/remotes: Fix leak in trace_remote_alloc_buffer() error path

From: Vincent Donnefort

Date: Fri Jul 10 2026 - 04:04:34 EST


On Fri, Jul 10, 2026 at 08:58:51AM +0100, Vincent Donnefort wrote:
> On Thu, Jul 09, 2026 at 07:15:16PM -0400, Steven Rostedt wrote:
> > On Thu, 9 Jul 2026 17:00:15 +0100
> > Vincent Donnefort <vdonnefort@xxxxxxxxxx> wrote:
> >
> > > If page allocation fails in trace_remote_alloc_buffer(), desc->nr_cpus
> > > is not yet incremented for the current CPU. As a consequence, on error,
> > > half-allocated rb_desc will not be freed in trace_remote_free_buffer().
> > >
> > > Increment desc->nr_cpus as soon as the first allocation for the current
> > > CPU has succeeded.
> > >
> > > Fixes: 96e43537af54 ("tracing: Introduce trace remotes")
> > > Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> > > Signed-off-by: Vincent Donnefort <vdonnefort@xxxxxxxxxx>
> >
> > This patch makes Sashiko find other possible issues with the code :-p
> >
> > https://sashiko.dev/#/patchset/20260709160017.1729517-2-vdonnefort%40google.com
>
> So one of them is fixed as part of "tracing/remotes: Add printk, dump_on_panic
> and boot parameters" [1]. I can pull those fixes into this series instead.
>
> I'll look at the rest.

Ha yes this other one is real too. However this is in arch/arm64/kvm/ so I'll
post it separately to kvmarm.

>
> [1] https://lore.kernel.org/all/20260605163825.1762953-2-vdonnefort@xxxxxxxxxx/
>
> >
> > -- Steve