From: Randy Dunlap <rdunlap@infradead.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Jonathan Marek <jonathan@marek.ca>,
stable@vger.kernel.org
Subject: Re: [PATCH] misc: fastrpc: restrict user apps from sending kernel RPC messages
Date: Thu, 11 Feb 2021 15:40:02 -0800 [thread overview]
Message-ID: <a11cdbfa-142e-57ae-cd5b-5e8aebd5f4cf@infradead.org> (raw)
In-Reply-To: <20210211233744.3348384-1-dmitry.baryshkov@linaro.org>
On 2/11/21 3:37 PM, Dmitry Baryshkov wrote:
> 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@linaro.org>
> Cc: Jonathan Marek <jonathan@marek.ca>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/misc/fastrpc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 815d01f785df..e7f3a22fdaa3 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -948,6 +948,11 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
> if (!fl->cctx->rpdev)
> return -EPIPE;
>
> + if (handle == FASTRPC_INIT_HANDLE && !kernel) {
> + dev_warn(fl->sctx->dev, "user app trying to send a kernel RPC message (%d)\n", handle);
rate limit so that userspace cannot flood kernel log?
> + return -EPERM;
> + }
> +
> ctx = fastrpc_context_alloc(fl, kernel, sc, args);
> if (IS_ERR(ctx))
> return PTR_ERR(ctx);
>
--
~Randy
prev parent reply other threads:[~2021-02-11 23:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 23:37 Dmitry Baryshkov
2021-02-11 23:40 ` Randy Dunlap [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a11cdbfa-142e-57ae-cd5b-5e8aebd5f4cf@infradead.org \
--to=rdunlap@infradead.org \
--cc=arnd@arndb.de \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jonathan@marek.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®