Skip to content

Commit 3845976

Browse files
Jianping-Liquic-vkatoch
authored andcommitted
FROMLIST: misc: fastrpc: Fail Audio PD init when reserved memory is missing
Audio PD static process creation assumes that a reserved-memory region is defined in DT and exposed via cctx->remote_heap. If reserved-memory is missing or incomplete, the driver may pass invalid address/size information to the DSP, leading to undefined behavior or crashes. Add explicit validation for remote_heap presence and size before sending the memory to DSP, and fail early if the configuration is invalid. Link: https://lore.kernel.org/all/20260526111124.515-4-jianping.li@oss.qualcomm.com/ Fixes: 0871561 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com> Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
1 parent f94666f commit 3845976

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/misc/fastrpc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,13 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
14691469
} inbuf;
14701470
u32 sc;
14711471

1472+
if (!fl->cctx->remote_heap ||
1473+
!fl->cctx->remote_heap->dma_addr ||
1474+
!fl->cctx->remote_heap->size) {
1475+
err = -ENOMEM;
1476+
dev_dbg(fl->sctx->dev, "remote heap memory region is not added\n");
1477+
return err;
1478+
}
14721479
args = kzalloc_objs(*args, FASTRPC_CREATE_STATIC_PROCESS_NARGS);
14731480
if (!args)
14741481
return -ENOMEM;

0 commit comments

Comments
 (0)