Skip to content

Commit 1c29d80

Browse files
ekanshibugregkh
authored andcommitted
misc: fastrpc: Reset metadata buffer to avoid incorrect free
Metadata buffer is allocated during get_args for any remote call. This buffer carries buffers, fdlists and other payload information for the call. If the buffer is not reset, put_args might find some garbage FDs in the fdlist which might have an existing mapping in the list. This could result in improper freeing of FD map when DSP might still be using the buffer. Added change to reset the metadata buffer after allocation. Fixes: 8f6c1d8 ("misc: fastrpc: Add fdlist implementation") Cc: stable <[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 5872080 commit 1c29d80

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/misc/fastrpc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
958958
if (err)
959959
return err;
960960

961+
memset(ctx->buf->virt, 0, pkt_size);
961962
rpra = ctx->buf->virt;
962963
list = fastrpc_invoke_buf_start(rpra, ctx->nscalars);
963964
pages = fastrpc_phy_page_start(list, ctx->nscalars);

0 commit comments

Comments
 (0)