Re: [PATCH v3 3/4] misc: fastrpc: fix possible map leak in fastrpc_put_args
From: Dmitry Baryshkov
Date: Thu Aug 14 2025 - 03:04:45 EST
On Thu, Aug 07, 2025 at 03:34:19PM +0530, Ling Xu wrote:
> copy_to_user() failure would cause an early return without cleaning up
> the fdlist, which has been updated by the DSP. This could lead to map
> leak. Fix this by redirecting to a cleanup path on failure, ensuring
> that all mapped buffers are properly released before returning.
>
> Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
> Cc: stable@xxxxxxxxxx
> Co-developed-by: Ekansh Gupta <ekansh.gupta@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ekansh Gupta <ekansh.gupta@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ling Xu <quic_lxu5@xxxxxxxxxxx>
> ---
> drivers/misc/fastrpc.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
--
With best wishes
Dmitry