This is a note to let you know that I've just added the patch titled misc: fastrpc: restrict user apps from sending kernel RPC messages to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: misc-fastrpc-restrict-user-apps-from-sending-kernel-rpc-messages.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 20c40794eb85ea29852d7bc37c55713802a543d6 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Date: Fri, 12 Feb 2021 22:26:58 +0300 Subject: misc: fastrpc: restrict user apps from sending kernel RPC messages From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> commit 20c40794eb85ea29852d7bc37c55713802a543d6 upstream. 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: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method") Cc: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Cc: Jonathan Marek <jonathan@xxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Link: https://lore.kernel.org/r/20210212192658.3476137-1-dmitry.baryshkov@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/misc/fastrpc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -924,6 +924,11 @@ static int fastrpc_internal_invoke(struc if (!fl->cctx->rpdev) return -EPIPE; + if (handle == FASTRPC_INIT_HANDLE && !kernel) { + dev_warn_ratelimited(fl->sctx->dev, "user app trying to send a kernel RPC message (%d)\n", handle); + return -EPERM; + } + ctx = fastrpc_context_alloc(fl, kernel, sc, args); if (IS_ERR(ctx)) return PTR_ERR(ctx); Patches currently in stable-queue which might be from dmitry.baryshkov@xxxxxxxxxx are queue-5.4/misc-fastrpc-restrict-user-apps-from-sending-kernel-rpc-messages.patch