<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/fastrpc.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-29T13:09:01+00:00</updated>
<entry>
<title>misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup</title>
<updated>2025-10-29T13:09:01+00:00</updated>
<author>
<name>Junhao Xie</name>
<email>bigfoot@radxa.com</email>
</author>
<published>2025-10-17T08:39:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e17b13387827adce7acb19ac0f07f9bcafe0ff4c'/>
<id>urn:sha1:e17b13387827adce7acb19ac0f07f9bcafe0ff4c</id>
<content type='text'>
commit fff111bf45cbeeb659324316d68554e35d350092 upstream.

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 &lt;bigfoot@radxa.com&gt;
Tested-by: Xilin Wu &lt;sophon@radxa.com&gt;
Link: https://lore.kernel.org/stable/48B368FB4C7007A7%2B20251017083906.3259343-1-bigfoot%40radxa.com
Link: https://patch.msgid.link/48B368FB4C7007A7+20251017083906.3259343-1-bigfoot@radxa.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Skip reference for DMA handles</title>
<updated>2025-10-15T10:00:23+00:00</updated>
<author>
<name>Ling Xu</name>
<email>quic_lxu5@quicinc.com</email>
</author>
<published>2025-09-12T13:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=802359a52676176b18713e33caa17572ad009057'/>
<id>urn:sha1:802359a52676176b18713e33caa17572ad009057</id>
<content type='text'>
commit 10df039834f84a297c72ec962c0f9b7c8c5ca31a upstream.

If multiple dma handles are passed with same fd over a remote call
the kernel driver takes a reference and expects that put for the
map will be called as many times to free the map. But DSP only
updates the fd one time in the fd list when the DSP refcount
goes to zero and hence kernel make put call only once for the
fd. This can cause SMMU fault issue as the same fd can be used
in future for some other call.

Fixes: 35a82b87135d ("misc: fastrpc: Add dma handle implementation")
Cc: stable@kernel.org
Co-developed-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ling Xu &lt;quic_lxu5@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srini@kernel.org&gt;
Link: https://lore.kernel.org/r/20250912131236.303102-5-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: fix possible map leak in fastrpc_put_args</title>
<updated>2025-10-15T10:00:23+00:00</updated>
<author>
<name>Ling Xu</name>
<email>quic_lxu5@quicinc.com</email>
</author>
<published>2025-09-12T13:12:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78d33a041555db03903e8037fd053ed74fbd88cb'/>
<id>urn:sha1:78d33a041555db03903e8037fd053ed74fbd88cb</id>
<content type='text'>
commit da1ba64176e0138f2bfa96f9e43e8c3640d01e1e upstream.

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@kernel.org
Co-developed-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ling Xu &lt;quic_lxu5@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srini@kernel.org&gt;
Link: https://lore.kernel.org/r/20250912131236.303102-4-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Fix fastrpc_map_lookup operation</title>
<updated>2025-10-15T10:00:23+00:00</updated>
<author>
<name>Ling Xu</name>
<email>quic_lxu5@quicinc.com</email>
</author>
<published>2025-09-12T13:12:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e0928a8988e873da9946e17f8065ad77c720186'/>
<id>urn:sha1:6e0928a8988e873da9946e17f8065ad77c720186</id>
<content type='text'>
commit 9031626ade38b092b72638dfe0c6ffce8d8acd43 upstream.

Fastrpc driver creates maps for user allocated fd buffers. Before
creating a new map, the map list is checked for any already existing
maps using map fd. Checking with just map fd is not sufficient as the
user can pass offsetted buffer with less size when the map is created
and then a larger size the next time which could result in memory
issues. Check for dma_buf object also when looking up for the map.

Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
Cc: stable@kernel.org
Co-developed-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ling Xu &lt;quic_lxu5@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srini@kernel.org&gt;
Link: https://lore.kernel.org/r/20250912131236.303102-3-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Save actual DMA size in fastrpc_map structure</title>
<updated>2025-10-15T10:00:23+00:00</updated>
<author>
<name>Ling Xu</name>
<email>quic_lxu5@quicinc.com</email>
</author>
<published>2025-09-12T13:12:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=35216e41b42fd9ce117a1e7b019a953644c851da'/>
<id>urn:sha1:35216e41b42fd9ce117a1e7b019a953644c851da</id>
<content type='text'>
commit 8b5b456222fd604079b5cf2af1f25ad690f54a25 upstream.

For user passed fd buffer, map is created using DMA calls. The
map related information is stored in fastrpc_map structure. The
actual DMA size is not stored in the structure. Store the actual
size of buffer and check it against the user passed size.

Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method")
Cc: stable@kernel.org
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Co-developed-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ekansh Gupta &lt;ekansh.gupta@oss.qualcomm.com&gt;
Signed-off-by: Ling Xu &lt;quic_lxu5@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srini@kernel.org&gt;
Link: https://lore.kernel.org/r/20250912131236.303102-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Fix copy buffer page size</title>
<updated>2025-02-17T09:05:41+00:00</updated>
<author>
<name>Ekansh Gupta</name>
<email>quic_ekangupt@quicinc.com</email>
</author>
<published>2025-01-10T13:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=24a79c6bc8de763f7c50f4f84f8b0c183bc25a51'/>
<id>urn:sha1:24a79c6bc8de763f7c50f4f84f8b0c183bc25a51</id>
<content type='text'>
commit e966eae72762ecfdbdb82627e2cda48845b9dd66 upstream.

For non-registered buffer, fastrpc driver copies the buffer and
pass it to the remote subsystem. There is a problem with current
implementation of page size calculation which is not considering
the offset in the calculation. This might lead to passing of
improper and out-of-bounds page size which could result in
memory issue. Calculate page start and page end using the offset
adjusted address instead of absolute address.

Fixes: 02b45b47fbe8 ("misc: fastrpc: fix remote page size calculation")
Cc: stable@kernel.org
Signed-off-by: Ekansh Gupta &lt;quic_ekangupt@quicinc.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20250110134239.123603-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Fix registered buffer page address</title>
<updated>2025-02-17T09:05:41+00:00</updated>
<author>
<name>Ekansh Gupta</name>
<email>quic_ekangupt@quicinc.com</email>
</author>
<published>2025-01-10T13:42:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=67419ee2c52b3eaa1538fd204364ed3c34959435'/>
<id>urn:sha1:67419ee2c52b3eaa1538fd204364ed3c34959435</id>
<content type='text'>
commit 6ca4ea1f88a06a04ed7b2c9c6bf9f00833b68214 upstream.

For registered  buffers, fastrpc driver sends the buffer information
to remote subsystem. There is a problem with current implementation
where the page address is being sent with an offset leading to
improper buffer address on DSP. This is leads to functional failures
as DSP expects base address in page information and extracts offset
information from remote arguments. Mask the offset and pass the base
page address to DSP.

This issue is observed is a corner case when some buffer which is registered
with fastrpc framework is passed with some offset by user and then the DSP
implementation tried to read the data. As DSP expects base address and takes
care of offsetting with remote arguments, passing an offsetted address will
result in some unexpected data read in DSP.

All generic usecases usually pass the buffer as it is hence is problem is
not usually observed. If someone tries to pass offsetted buffer and then
tries to compare data at HLOS and DSP end, then the ambiguity will be observed.

Fixes: 80f3afd72bd4 ("misc: fastrpc: consider address offset before sending to DSP")
Cc: stable@kernel.org
Signed-off-by: Ekansh Gupta &lt;quic_ekangupt@quicinc.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20250110134239.123603-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Deregister device nodes properly in error scenarios</title>
<updated>2025-02-17T09:05:41+00:00</updated>
<author>
<name>Anandu Krishnan E</name>
<email>quic_anane@quicinc.com</email>
</author>
<published>2025-01-10T13:42:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a2544ebcb466e5a19c06ee30ae36919127fec0d7'/>
<id>urn:sha1:a2544ebcb466e5a19c06ee30ae36919127fec0d7</id>
<content type='text'>
commit 637c20002dc8c347001292664055bfbf56544ec6 upstream.

During fastrpc_rpmsg_probe, if secure device node registration
succeeds but non-secure device node registration fails, the secure
device node deregister is not called during error cleanup. Add proper
exit paths to ensure proper cleanup in case of error.

Fixes: 3abe3ab3cdab ("misc: fastrpc: add secure domain support")
Cc: stable@kernel.org
Signed-off-by: Anandu Krishnan E &lt;quic_anane@quicinc.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20250110134239.123603-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 6.11-rc7 into char-misc-next</title>
<updated>2024-09-09T06:36:23+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-09-09T06:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=895b4fae931a256f6c7c6c68f77a8e337980b5a1'/>
<id>urn:sha1:895b4fae931a256f6c7c6c68f77a8e337980b5a1</id>
<content type='text'>
We need the char-misc fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Fix double free of 'buf' in error path</title>
<updated>2024-09-03T10:19:31+00:00</updated>
<author>
<name>Sukrut Bellary</name>
<email>sukrut.bellary@linux.com</email>
</author>
<published>2024-09-02T14:14:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8c276d4dc0e19ee48385f74426aebc855b49aaf'/>
<id>urn:sha1:e8c276d4dc0e19ee48385f74426aebc855b49aaf</id>
<content type='text'>
smatch warning:
drivers/misc/fastrpc.c:1926 fastrpc_req_mmap() error: double free of 'buf'

In fastrpc_req_mmap() error path, the fastrpc buffer is freed in
fastrpc_req_munmap_impl() if unmap is successful.

But in the end, there is an unconditional call to fastrpc_buf_free().
So the above case triggers the double free of fastrpc buf.

Fixes: 72fa6f7820c4 ("misc: fastrpc: Rework fastrpc_req_munmap")
Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Sukrut Bellary &lt;sukrut.bellary@linux.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/20240902141409.70371-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
