FAILED: patch "[PATCH] misc: fastrpc: fix DMA address corruption due to find_vma" failed to apply to 5.10-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 464c6ad2aa16e1e1df9d559289199356493d1e00
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026061542-daybreak-anemic-ed9c@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 464c6ad2aa16e1e1df9d559289199356493d1e00 Mon Sep 17 00:00:00 2001
From: Junrui Luo <[email protected]>
Date: Sat, 30 May 2026 21:45:26 +0100
Subject: [PATCH] misc: fastrpc: fix DMA address corruption due to find_vma
misuse
fastrpc_get_args() uses find_vma() to look up the VMA for a user-provided pointer and compute a DMA address offset. When the address falls in a gap before the returned VMA, (ptr & PAGE_MASK) - vma->vm_start underflows, corrupting the DMA address sent to the DSP.
Replace find_vma() with vma_lookup(), which returns NULL when the address is not contained within any VMA.
drivers/misc/fastrpc.c +1 -1
@@ -1090,7 +1090,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) pages[i].addr = ctx->maps[i]->dma_addr;mmap_read_lock (current->mm); - vma =find_vma (current->mm, ctx->args[i].ptr); + vma =vma_lookup (current->mm, ctx->args[i].ptr);if (vma) pages[i].addr += (ctx->args[i].ptr &PAGE_MASK ) - vma->vm_start;
Sasha Levin
maintainerPATCH 1/1 misc: fastrpc: fix DMA address corruption due to find_vma misuse
From: Junrui Luo <[email protected]>
[ Upstream commit 464c6ad2aa16e1e1df9d559289199356493d1e00 ]
fastrpc_get_args() uses find_vma() to look up the VMA for a user-provided pointer and compute a DMA address offset. When the address falls in a gap before the returned VMA, (ptr & PAGE_MASK) - vma->vm_start underflows, corrupting the DMA address sent to the DSP.
Replace find_vma() with vma_lookup(), which returns NULL when the address is not contained within any VMA.
--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -1
@@ -825,7 +825,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)mmap_read_lock (current->mm); vma =find_vma (current->mm, ctx->args[i].ptr); -if (vma) +if (vma && ctx->args[i].ptr >= vma->vm_start) pages[i].addr += (ctx->args[i].ptr &PAGE_MASK ) - vma->vm_start;mmap_read_unlock (current->mm);
Signature · 1 line
2.53.0