From: "Vesa Jääskeläinen" <dachaac@gmail.com>
To: Jens Wiklander <jens.wiklander@linaro.org>,
Sumit Garg <sumit.garg@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@vger.kernel.org>,
Devicetree List <devicetree@vger.kernel.org>,
mpm@selenic.com, Herbert Xu <herbert@gondor.apana.org.au>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Bhupesh Sharma <bhsharma@redhat.com>,
tee-dev@lists.linaro.org
Subject: Re: [PATCH v1 2/2] hwrng: add OP-TEE based rng driver
Date: Sun, 30 Dec 2018 16:59:46 +0200 [thread overview]
Message-ID: <79744651-991d-ff44-2238-96721ff9bc18@gmail.com> (raw)
In-Reply-To: <20181228144610.GA21561@jax.urgonet>
Hi All,
On 28/12/2018 16.46, Jens Wiklander wrote:
> Hi Sumit,
>
> On Fri, Dec 28, 2018 at 06:33:22PM +0530, Sumit Garg wrote:
>> On Fri, 28 Dec 2018 at 16:08, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> Jens,
>>
>> Is there any particular reason to wait indefinitely in
>> "optee_supp_thrd_req" if there is no supplicant running? I think we
>> should probably return as follows from "optee_supp_thrd_req" API in
>> case no supplicant is available:
>>
>> --- a/drivers/tee/optee/supp.c
>> +++ b/drivers/tee/optee/supp.c
>> @@ -88,10 +88,15 @@ u32 optee_supp_thrd_req(struct tee_context *ctx,
>> u32 func, size_t num_params,
>> {
>> struct optee *optee = tee_get_drvdata(ctx->teedev);
>> struct optee_supp *supp = &optee->supp;
>> - struct optee_supp_req *req = kzalloc(sizeof(*req), GFP_KERNEL);
>> + struct optee_supp_req *req;
>> bool interruptable;
>> u32 ret;
>>
>> + /* Return in case there is no supplicant available */
>> + if (!supp->ctx)
>> + return TEEC_ERROR_COMMUNICATION;
>> +
>> + req = kzalloc(sizeof(*req), GFP_KERNEL);
>> if (!req)
>> return TEEC_ERROR_OUT_OF_MEMORY;
>
> From a user space point of view it has been more useful to just wait
> until the supplicant starts to serve requests than polling the interface
> until the call succeeds. For this new use case it makes more sense to be
> able to return an error instead.
>
> The proposed change is a user space API change, so we will need to do a
> bit more than that.
There are parts of kernel that need randomness before user space is ready.
Can't we move necessary logic for this to in kernel now that there is
kernel service requiring TEE services?
I suppose there are even more services that would be better to be only
optee<->kernel interface and not exposed as such to user space. One
example of such would be mass storage encryption key or hardware rooted
encryption for Linux keyring. Eg. replacement for TPM chip when TEE
environment is available.
Thanks,
Vesa Jääskeläinen
next prev parent reply other threads:[~2018-12-30 14:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-27 11:07 [PATCH v1 0/2] Add OP-TEE based hwrng driver Sumit Garg
2018-12-27 11:07 ` [PATCH v1 1/2] dt/bindings: add bindings for optional optee rng-uuid property Sumit Garg
2018-12-27 13:39 ` Ard Biesheuvel
2018-12-28 9:11 ` Sumit Garg
2019-01-03 17:14 ` Daniel Thompson
2019-01-04 6:39 ` Sumit Garg
2019-01-04 11:01 ` Jens Wiklander
2019-01-04 12:01 ` Sumit Garg
2019-01-04 13:03 ` Jens Wiklander
2019-01-07 5:32 ` Sumit Garg
2019-01-07 5:59 ` Ard Biesheuvel
2019-01-07 6:46 ` Sumit Garg
2019-01-03 16:20 ` Rob Herring
2018-12-27 11:07 ` [PATCH v1 2/2] hwrng: add OP-TEE based rng driver Sumit Garg
2018-12-27 18:28 ` Ard Biesheuvel
2018-12-28 9:58 ` Sumit Garg
2018-12-28 10:38 ` Ard Biesheuvel
2018-12-28 13:03 ` Sumit Garg
2018-12-28 14:46 ` Jens Wiklander
2018-12-30 14:59 ` Vesa Jääskeläinen [this message]
2018-12-31 10:35 ` Sumit Garg
2018-12-31 10:24 ` Sumit Garg
2019-01-02 8:04 ` Jens Wiklander
2019-01-02 8:26 ` Bhupesh Sharma
2019-01-02 10:12 ` Sumit Garg
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=79744651-991d-ff44-2238-96721ff9bc18@gmail.com \
--to=dachaac@gmail.com \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=bhsharma@redhat.com \
--cc=daniel.thompson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=jens.wiklander@linaro.org \
--cc=linux-crypto@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mpm@selenic.com \
--cc=robh+dt@kernel.org \
--cc=sumit.garg@linaro.org \
--cc=tee-dev@lists.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;
as well as URLs for NNTP newsgroup(s).