Re: [PATCH] ASoC: SOF: ipc4-pcm: Adjust pipeline_list->pipelines allocation type

From: Kees Cook
Date: Wed Apr 30 2025 - 17:03:39 EST


On Mon, Apr 28, 2025 at 03:38:30PM +0300, Péter Ujfalusi wrote:
>
>
> On 26/04/2025 09:25, Kees Cook wrote:
> > In preparation for making the kmalloc family of allocators type aware,
> > we need to make sure that the returned type from the allocation matches
> > the type of the variable being assigned. (Before, the allocator would
> > always return "void *", which can be implicitly cast to any pointer type.)
> >
> > The assigned type is "struct snd_sof_pipeline **", but the returned type
> > will be "struct snd_sof_widget **". These are the same size allocation
> > (pointer size) but the types don't match. Adjust the allocation type to
> > match the assignment.
>
> It looks like that this is indeed an oversight and a bug introduced by a
> mostly mechanical change (introduced in v6.3).
>
> Can you add:
> Fixes: 9c04363d222b ("ASoC: SOF: Introduce struct snd_sof_pipeline")
>
> and:
> Acked-by: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>

Thanks! I can carry the patch if you'd like? I assumed this would go
through regular maintainers.

-Kees

--
Kees Cook