On Fri, May 22, 2026 at 03:47:31PM +0800, Jianping Li wrote:
> 
> On 5/15/2026 9:38 PM, Dmitry Baryshkov wrote:
> > On Fri, May 15, 2026 at 08:42:16PM +0800, Jianping Li wrote:
> > > Allocating and freeing Audio PD memory from userspace is unsafe because
> > > the kernel cannot reliably determine when the DSP has finished using the
> > > memory. Userspace may free buffers while they are still in use by the DSP,
> > > and remote free requests cannot be safely trusted.
> > > 
> > > Allocate the entire Audio PD reserved-memory region upfront during rpmsg
> > > probe and tie its lifetime to the rpmsg channel. This avoids userspace-
> > > controlled alloc/free and ensures memory is reclaimed only when the DSP
> > > shuts down.
> > So, is this a bugfix or not? Is it possible to make the kernel misbehave
> > without this patch being applied?
> 
> Yes, this is a bug fix.

The tag, cc:stable, clear description as the bugfix? How would anybody
guess if the patch is to be backported to earlier kernels or not?

> Because currently after the audio PD requests to grow the heap,
> the current kernel does not support shrinking the heap, which will all cause 
> memory leaks.
> 
> The current modification is to allocate in advance and release uniformly, 
> which will avoid this error.
> 
> Thanks,
> Jianping.
> 
> > 
> > > Signed-off-by: Jianping Li <[email protected]>
> > > ---
> > >   drivers/misc/fastrpc.c | 107 +++++++++++++++++++----------------------
> > >   1 file changed, 49 insertions(+), 58 deletions(-)
> > > 

-- 
With best wishes
Dmitry

Reply via email to