Skip to content

Commit 20c4079

Browse files
lumaggregkh
authored andcommitted
misc: fastrpc: restrict user apps from sending kernel RPC messages
Verify that user applications are not using the kernel RPC message handle to restrict them from directly attaching to guest OS on the remote subsystem. This is a port of CVE-2019-2308 fix. Fixes: c68cfb7 ("misc: fastrpc: Add support for context Invoke method") Cc: Srinivas Kandagatla <[email protected]> Cc: Jonathan Marek <[email protected]> Cc: [email protected] Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1201d68 commit 20c4079

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/misc/fastrpc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,11 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
950950
if (!fl->cctx->rpdev)
951951
return -EPIPE;
952952

953+
if (handle == FASTRPC_INIT_HANDLE && !kernel) {
954+
dev_warn_ratelimited(fl->sctx->dev, "user app trying to send a kernel RPC message (%d)\n", handle);
955+
return -EPERM;
956+
}
957+
953958
ctx = fastrpc_context_alloc(fl, kernel, sc, args);
954959
if (IS_ERR(ctx))
955960
return PTR_ERR(ctx);

0 commit comments

Comments
 (0)