Skip to content

Commit 6ca4ea1

Browse files
ekanshibugregkh
authored andcommitted
misc: fastrpc: Fix registered buffer page address
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: 80f3afd ("misc: fastrpc: consider address offset before sending to DSP") Cc: [email protected] Signed-off-by: Ekansh Gupta <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 637c200 commit 6ca4ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/fastrpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
992992
mmap_read_lock(current->mm);
993993
vma = find_vma(current->mm, ctx->args[i].ptr);
994994
if (vma)
995-
pages[i].addr += ctx->args[i].ptr -
995+
pages[i].addr += (ctx->args[i].ptr & PAGE_MASK) -
996996
vma->vm_start;
997997
mmap_read_unlock(current->mm);
998998

0 commit comments

Comments
 (0)