[<prev] [next>] [day] [month] [year] [list]
Message-ID: <48B368FB4C7007A7+20251017083906.3259343-1-bigfoot@radxa.com>
Date: Fri, 17 Oct 2025 16:39:06 +0800
From: Junhao Xie <bigfoot@...xa.com>
To: Srinivas Kandagatla <srini@...nel.org>,
Amol Maheshwari <amahesh@....qualcomm.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ling Xu <quic_lxu5@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
stable@...r.kernel.org,
Junhao Xie <bigfoot@...xa.com>,
stable@...nel.org,
Xilin Wu <sophon@...xa.com>
Subject: [PATCH] misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
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@...nel.org
Signed-off-by: Junhao Xie <bigfoot@...xa.com>
Tested-by: Xilin Wu <sophon@...xa.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
Powered by blists - more mailing lists