public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
@ 2025-10-17  8:39 Junhao Xie
  2025-10-17  8:43 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Junhao Xie @ 2025-10-17  8:39 UTC (permalink / raw)
  To: Srinivas Kandagatla, Amol Maheshwari
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Ling Xu, Dmitry Baryshkov,
	linux-arm-msm, linux-kernel, stable, Junhao Xie, stable, Xilin Wu

In fastrpc_map_lookup, dma_buf_get is called to obtain a reference to
the dma_buf for comparison purposes. However, this reference is never
released when the function returns, leading to a dma_buf memory leak.

Fix this by adding dma_buf_put before returning from the function,
ensuring that the temporarily acquired reference is properly released
regardless of whether a matching map is found.

Fixes: 9031626ade38 ("misc: fastrpc: Fix fastrpc_map_lookup operation")
Cc: stable@kernel.org
Signed-off-by: Junhao Xie <bigfoot@radxa.com>
Tested-by: Xilin Wu <sophon@radxa.com>
---
 drivers/misc/fastrpc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 621bce7e101c1..ee652ef01534a 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -381,6 +381,8 @@ static int fastrpc_map_lookup(struct fastrpc_user *fl, int fd,
 	}
 	spin_unlock(&fl->lock);
 
+	dma_buf_put(buf);
+
 	return ret;
 }
 
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
  2025-10-17  8:39 [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup Junhao Xie
@ 2025-10-17  8:43 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-10-17  8:43 UTC (permalink / raw)
  To: Junhao Xie; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
Link: https://lore.kernel.org/stable/48B368FB4C7007A7%2B20251017083906.3259343-1-bigfoot%40radxa.com

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-17  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  8:39 [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup Junhao Xie
2025-10-17  8:43 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox