From: Ekansh Gupta <quic_ekangupt@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <srinivas.kandagatla@linaro.org>, <linux-arm-msm@vger.kernel.org>,
<gregkh@linuxfoundation.org>, <quic_bkumar@quicinc.com>,
<linux-kernel@vger.kernel.org>, <quic_chennak@quicinc.com>,
<dri-devel@lists.freedesktop.org>, <arnd@arndb.de>,
stable <stable@kernel.org>
Subject: Re: [PATCH v2] misc: fastrpc: Remove user PD initmem size check
Date: Fri, 28 Jun 2024 16:12:10 +0530 [thread overview]
Message-ID: <a5e69a5e-b882-4f36-b023-f85da430fa2f@quicinc.com> (raw)
In-Reply-To: <f3d502ca-228e-4be4-b296-a9073975d34b@quicinc.com>
On 6/28/2024 3:59 PM, Ekansh Gupta wrote:
>
> On 6/27/2024 4:43 PM, Dmitry Baryshkov wrote:
>> On Thu, Jun 27, 2024 at 11:35:18AM GMT, Ekansh Gupta wrote:
>>> For user PD initialization, initmem is allocated and sent to DSP for
>>> initial memory requirements like shell loading. This size is passed
>>> by user space and is checked against a max size. For unsigned PD
>>> offloading, more than 2MB size could be passed by user which would
>>> result in PD initialization failure. Remove the user PD initmem size
>>> check and allow buffer allocation for user passed size. Any additional
>>> memory sent to DSP during PD init is used as the PD heap.
>> Would it allow malicious userspace to allocate big enough buffers and
>> reduce the amount of memory available to the system? To other DSP
>> programs?
> The allocation here is happening from SMMU context bank which is uniquely assigned
> to processes going to DSP. As per my understanding process can allocate maximum
> 4GB of memory from the context bank and the memory availability will be taken care
> by kernel memory management. Please correct me if my understanding is incorrect.
Just wanted to add 1 question here:
User space can also directly allocate memory. Wouldn't that be a problem if any malicious userspace
allocated huge memory? Is there any bound check or is it handled differently? Please help me with
some information here.
> --Ekansh
>>> Fixes: 7f1f481263c3 ("misc: fastrpc: check before loading process to the DSP")
>>> Cc: stable <stable@kernel.org>
>>> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>> ---
>>> Changes in v2:
>>> - Modified commit text.
>>> - Removed size check instead of updating max file size.
>>>
>>> drivers/misc/fastrpc.c | 5 -----
>>> 1 file changed, 5 deletions(-)
>>>
>>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>>> index 5204fda51da3..9d064deeac89 100644
>>> --- a/drivers/misc/fastrpc.c
>>> +++ b/drivers/misc/fastrpc.c
>>> @@ -1389,11 +1389,6 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
>>> goto err;
>>> }
>>>
>>> - if (init.filelen > INIT_FILELEN_MAX) {
>>> - err = -EINVAL;
>>> - goto err;
>>> - }
>>> -
>>> inbuf.pgid = fl->tgid;
>>> inbuf.namelen = strlen(current->comm) + 1;
>>> inbuf.filelen = init.filelen;
>>> --
>>> 2.34.1
>>>
>
next prev parent reply other threads:[~2024-06-28 10:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 6:05 Ekansh Gupta
2024-06-27 11:13 ` Dmitry Baryshkov
2024-06-28 10:29 ` Ekansh Gupta
2024-06-28 10:42 ` Ekansh Gupta [this message]
2024-06-28 14:21 ` Greg KH
2024-07-01 5:20 ` Ekansh Gupta
2024-07-01 17:11 ` Dmitry Baryshkov
2024-07-02 7:07 ` Ekansh Gupta
2024-07-02 9:40 ` Dmitry Baryshkov
2024-07-03 6:44 ` Ekansh Gupta
2024-07-03 9:34 ` Dmitry Baryshkov
2024-06-27 11:20 ` Greg KH
2024-06-27 11:21 ` Greg KH
2024-06-28 10:37 ` Ekansh Gupta
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=a5e69a5e-b882-4f36-b023-f85da430fa2f@quicinc.com \
--to=quic_ekangupt@quicinc.com \
--cc=arnd@arndb.de \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_bkumar@quicinc.com \
--cc=quic_chennak@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=stable@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®