<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/fastrpc.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-29T13:04:39+00:00</updated>
<entry>
<title>misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup</title>
<updated>2025-10-29T13:04:39+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=c2fef5ebb73f3dabae6fbc571d181914ed32c483'/>
<id>urn:sha1:c2fef5ebb73f3dabae6fbc571d181914ed32c483</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-15T09:56:40+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=0b70ec82b309a4093106ff399da1911ad23b52d3'/>
<id>urn:sha1:0b70ec82b309a4093106ff399da1911ad23b52d3</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-15T09:56:40+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=a085658264d0c8d4f795d4631f77d7289a021de9'/>
<id>urn:sha1:a085658264d0c8d4f795d4631f77d7289a021de9</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-15T09:56:40+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=ec5cb80503bbfee67573699fe52fcf456fd57678'/>
<id>urn:sha1:ec5cb80503bbfee67573699fe52fcf456fd57678</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: Fix copy buffer page size</title>
<updated>2025-02-21T12:49:52+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=c56ba3ea8e3c9a69a992aad18f7a65e43e51d623'/>
<id>urn:sha1:c56ba3ea8e3c9a69a992aad18f7a65e43e51d623</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-21T12:49:52+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=9c37be4abf7feb9e7bc9e6e6b7b65a24f87ca609'/>
<id>urn:sha1:9c37be4abf7feb9e7bc9e6e6b7b65a24f87ca609</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-21T12:49:52+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=894efd31d02a4d432ddc1b87420e0a20fbbde4ac'/>
<id>urn:sha1:894efd31d02a4d432ddc1b87420e0a20fbbde4ac</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>misc: fastrpc: Copy the complete capability structure to user</title>
<updated>2024-07-18T11:18:42+00:00</updated>
<author>
<name>Ekansh Gupta</name>
<email>quic_ekangupt@quicinc.com</email>
</author>
<published>2024-06-28T11:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c6e06ce3439254585fe745d5529d60ea30b36cae'/>
<id>urn:sha1:c6e06ce3439254585fe745d5529d60ea30b36cae</id>
<content type='text'>
commit e7f0be3f09c6e955dc8009129862b562d8b64513 upstream.

User is passing capability ioctl structure(argp) to get DSP
capabilities. This argp is copied to a local structure to get domain
and attribute_id information. After getting the capability, only
capability value is getting copied to user argp which will not be
useful if the use is trying to get the capability by checking the
capability member of fastrpc_ioctl_capability structure. Copy the
complete capability structure so that user can get the capability
value from the expected member of the structure.

Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ekansh Gupta &lt;quic_ekangupt@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Reviewed-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20240628114501.14310-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Avoid updating PD type for capability request</title>
<updated>2024-07-18T11:18:42+00:00</updated>
<author>
<name>Ekansh Gupta</name>
<email>quic_ekangupt@quicinc.com</email>
</author>
<published>2024-06-28T11:44:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6cdce36ee7af66385fcc61efca5b1793acdf416'/>
<id>urn:sha1:f6cdce36ee7af66385fcc61efca5b1793acdf416</id>
<content type='text'>
commit bfb6b07d2a30ffe98864d8cfc31fc00470063025 upstream.

When user is requesting for DSP capability, the process pd type is
getting updated to USER_PD which is incorrect as DSP will assume the
process which is making the request is a user PD and this will never
get updated back to the original value. The actual PD type should not
be updated for capability request and it should be serviced by the
respective PD on DSP side. Don't change process's PD type for DSP
capability request.

Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ekansh Gupta &lt;quic_ekangupt@quicinc.com&gt;
Reviewed-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20240628114501.14310-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: fastrpc: Fix DSP capabilities request</title>
<updated>2024-07-18T11:18:42+00:00</updated>
<author>
<name>Ekansh Gupta</name>
<email>quic_ekangupt@quicinc.com</email>
</author>
<published>2024-06-28T11:44:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=943f153d1f9da4a48244af4b4ee9ea256d64df04'/>
<id>urn:sha1:943f153d1f9da4a48244af4b4ee9ea256d64df04</id>
<content type='text'>
commit 4cb7915f0a35e2fcc4be60b912c4be35cd830957 upstream.

The DSP capability request call expects 2 arguments. First is the
information about the total number of attributes to be copied from
DSP and second is the information about the buffer where the DSP
needs to copy the information. The current design is passing the
information about the size to be copied from DSP which would be
considered as a bad argument to the call by DSP causing a failure
suggesting the same. The second argument carries the information
about the buffer where the DSP needs to copy the capability
information and the size to be copied. As the first entry of
capability attribute is getting skipped, same should also be
considered while sending the information to DSP. Add changes to
pass proper arguments to DSP.

Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ekansh Gupta &lt;quic_ekangupt@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Reviewed-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20240628114501.14310-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
