Re: [PATCH v5 4/5] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe
From: Dmitry Baryshkov
Date: Fri May 15 2026 - 09:51:06 EST
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?
>
> Signed-off-by: Jianping Li <jianping.li@xxxxxxxxxxxxxxxx>
> ---
> drivers/misc/fastrpc.c | 107 +++++++++++++++++++----------------------
> 1 file changed, 49 insertions(+), 58 deletions(-)
>
--
With best wishes
Dmitry