public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Johan Hovold <johan@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Sumit Garg <sumit.garg@linaro.org>,
	Steev Klimaszewski <steev@kali.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] firmware: qcom_scm: Export SCM call functions
Date: Wed, 8 Mar 2023 16:09:49 +0100	[thread overview]
Message-ID: <3144d7cd-0b17-6236-5575-cfbb1a71d1ab@gmail.com> (raw)
In-Reply-To: <afee5468-6c73-d088-e3ab-e9314492e49b@linaro.org>

On 3/8/23 15:20, Srinivas Kandagatla wrote:
> 
> 
> On 08/03/2023 13:48, Maximilian Luz wrote:
>> On 3/8/23 13:53, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 07/03/2023 15:23, Dmitry Baryshkov wrote:
>>>>
>>>>> Make qcom_scm_call, qcom_scm_call_atomic and associated types accessible
>>>>> to other modules.
>>>>
>>>> Generally all the qcom_scm calls are a part of qcom_scm.c. I think it is better to make qseecom_scm_call a part qcom_scm.c (as we were previously doing) rather than exporting the core function.
>>>>
>>>
>>> Other big issue I see in exporting qcom_scm_call() is that there is danger of misuse of this api as this could lead to a path where new apis and its payloads can come directly from userspace via a rogue/hacking modules. This will bypass scm layer completely within kernel.
>>
>> I'm not sure I follow your argument here. If you have the possibility to
>> load your own kernel modules, can you not always bypass the kernel and
>> just directly invoke the respective SCM calls manually? So this is
>> superficial security at best.
> qcom_scm_call() will expose a much bigger window where the user can add new SCM APIs but with the current model of exporting symbols at SCM API level will narrow that down to that API.
> 
>>
>> I guess keeping it in qcom_scm could make it easier to spot new
>> in-kernel users of that function and with that better prevent potential
>> misuse in the kernel itself. But then again I'd hope that our review
>> system is good enough to catch such issues regardless and thoroughly
>> question calls to that function (especially ones involving user-space
>> APIs). 
> 
> One problem I can immediately see here is the facility that will be exploited and promote more development outside upstream.
> 
> ex: vendor modules with GKI compliance.

Fair point.

I still believe that squashing everything into a single driver is not
particularly great code/architecture style, but then again I'm not a fan of
vendors not integrating their stuff upstream either.

I guess we should be able to find something that has sufficiently low
complexity so that it can be implemented in qcom_scm while also preventing
external use like that.

Regards,
Max

> 
> --srini
>>
>> Regards,
>> Max
>>
>>>
>>> --srini
>>>
>>>> If you wish to limit the kernel bloat, you can split the qcom_scm into per-driver backend and add Kconfig symbols to limit the impact. However I think that these functions are pretty small to justify the effort.
>>>>
>>>
>>>
>>>>>
>>>>> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>

  reply	other threads:[~2023-03-08 15:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05  2:21 [PATCH v3 0/4] firmware: Add support for Qualcomm UEFI Secure Application Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 1/4] firmware: qcom_scm: Export SCM call functions Maximilian Luz
2023-03-07 15:23   ` Dmitry Baryshkov
2023-03-08 12:53     ` Srinivas Kandagatla
2023-03-08 13:48       ` Maximilian Luz
2023-03-08 14:20         ` Srinivas Kandagatla
2023-03-08 15:09           ` Maximilian Luz [this message]
2023-03-08 13:29     ` Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 2/4] firmware: Add support for Qualcomm Secure Execution Environment SCM interface Maximilian Luz
2023-03-07 15:32   ` Dmitry Baryshkov
2023-03-08 13:59     ` Maximilian Luz
2023-03-09  8:45       ` Dmitry Baryshkov
2023-03-09 20:54         ` Maximilian Luz
2023-03-07 15:36   ` Dmitry Baryshkov
2023-03-08 14:06     ` Maximilian Luz
2023-03-09  8:07       ` Dmitry Baryshkov
2023-03-05  2:21 ` [PATCH v3 3/4] dt-bindings: firmware: Add Qualcomm QSEECOM interface Maximilian Luz
2023-03-08 22:16   ` Rob Herring
2023-03-08 22:44     ` Maximilian Luz
2023-03-09  1:33       ` Dmitry Baryshkov
2023-03-09  2:27         ` Maximilian Luz
2023-03-09  8:19           ` Dmitry Baryshkov
2023-03-09 20:34             ` Maximilian Luz
2023-03-09 20:43               ` Dmitry Baryshkov
2023-05-02  8:38           ` Sudeep Holla
2023-05-02 10:52             ` Maximilian Luz
2023-05-02  8:31       ` Krzysztof Kozlowski
2023-05-02 10:57         ` Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 4/4] firmware: Add support for Qualcomm UEFI Secure Application Maximilian Luz
2023-03-07 15:51   ` Dmitry Baryshkov
2023-03-08 15:02     ` Maximilian Luz
2023-03-09  8:36       ` Dmitry Baryshkov
2023-03-09 20:44         ` Maximilian Luz
2023-06-29 12:26     ` Johan Hovold

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=3144d7cd-0b17-6236-5575-cfbb1a71d1ab@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=ardb@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=johan@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=steev@kali.org \
    --cc=sudeep.holla@arm.com \
    --cc=sumit.garg@linaro.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