xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Cc: Julien Grall <julien.grall@arm.com>,
	nd@arm.com, Stefano Stabellini <sstabellini@kernel.org>,
	jens.wiklander@linaro.org, xen-devel@lists.xen.org
Subject: Re: [RFC 0/4] TEE mediator framework + OP-TEE mediator
Date: Tue, 7 Nov 2017 16:03:14 +0000	[thread overview]
Message-ID: <3533f9e7-c9b4-09ee-eee6-c26901e68da1@linaro.org> (raw)
In-Reply-To: <20171102200705.GA22679@EPUAKYIW2556.kyiv.epam.com>

Hi Volodymyr,

On 02/11/17 20:07, Volodymyr Babchuk wrote:
> On Thu, Nov 02, 2017 at 05:49:12PM +0000, Julien Grall wrote:
>> On 02/11/17 16:53, Volodymyr Babchuk wrote:
>>> On Thu, Nov 02, 2017 at 01:17:26PM +0000, Julien Grall wrote:
>>>> On 24/10/17 20:02, Volodymyr Babchuk wrote:
>>> But parameters are mapped every call and only needed ones.
>>> Example: I have shared buffers A, B, C, D.
>>>
>>> 1) I call OpenSession(TA_UUID, A, B).
>>>     TA sees only buffers A, B (okay, actually it sees whole page, because
>>>     buffer is mapped from userspace).
>>>
>>> 2) I call InvokeCommand(Session, CMD_ID, B, C).
>>>     TA sees only buffers B & C.
>>>
>>> 3) I call InvokeCommand(Session, CMD_ID, A, D).
>>>     TA sees only buffers A & D.
>>>
>>> Note, that such buffers are not mapped at OP-TEE address space at all.
>>> They will be mapped only to TA address space.
>>
>> To confirm, what you are saying is as soon as any call is returned by TA,
>> the region will be unmapped from the TA address space?
> Yes.
> Also, just to clarify: TA executes only by request from client. It
> can't have external events. So, TA address space is somewhat ephemeral
> entity. It exists only during time between TA entry and TA exit. At
> all other times, TA does have no address space, no thread context,
> anything. Just code and data somewhere in memory.

That's quite a good news :). Thank you for the explanation.

> 
>>>
>>> [...]
>>>>>>>>>>>> To be clear, this series don't look controversial at least for OP-TEE. What
>>>>>>>>>>>> I am more concerned is about DomU supports.
>>>>>>>>>>> Your concern is that rogue DomU can compromise whole system, right?
>>>>>>>>>>
>>>>>>>>>> Yes. You seem to assume that DomU using TEE will always be trusted, I think
>>>>>>>>>> this is the wrong approach if the use is able to interact directly with
>>>>>>>>>> those guests. See above.
>>>>>>>>> No, I am not assuming that DomU that calls TEE should be trusted. Why do you
>>>>>>>>> think so? It should be able to use TEE services, but this does not mean that
>>>>>>>>> XEN should trust it.
>>>>>>>>
>>>>>>>> In a previous answer you said: "So, if you don't trust your guest - don't
>>>>>>>> let it". For me, this clearly means you consider that DomU using TEE are
>>>>>>>> trusted.
>>>>>>>>
>>>>>>>> So can you clarify by what you mean by trust then?
>>>>>>> Well... In real world "trust" isn't binary option. You don't want to
>>>>>>> allow all domains to access TEE. Breached TEE user domain doesn't
>>>>>>> automatically mean that your whole system is compromised. But this
>>>>>>> certainly increases attack surface. So it is safer to give TEE access
>>>>>>> only to those domains, which really require it. You can call them
>>>>>>> sligtly more trusted, then others.
>>>>>>
>>>>>> Do you have an example of guest you would slightly trust more?
>>>>> I have an example of guest I would trust less: if I'm running server,
>>>>> and I'm selling virtual machines on that server, I don't want to them
>>>>> to access TEE.
>>>>
>>>> Make sense.
>>>>
>>>>>
>>>>> I will trust slightly more to my own guest.
>>>>
>>>> I kind of agree if there are either no interaction with the user or the user
>>>> is not able to gain privilege permissions.
>>> Okay, if user can execute arbitrary code at EL1... Even then nothing bad
>>> will happen. They must be able to hack mediator/hypervisor/OP-TEE to realy
>>> gain priviegs in system.
>>
>> My worry here is you base the trust on OP-TEE and not only the hypervisor.
>> At the moment we had to trust the hardware to do the right thing and the
>> software is owned by Xen.
> How about firmware? E.g. ARM TF?

My point here was anything involved in virtualization is at the moment 
the hardware and Xen. The ARM TF/firmware cannot be accessed 
directly/indirectly by any guest. So there are no concern to me.

> 
>> Now you are telling me, we have this TEE running in EL3 and have to trust
>> him to do the isolation between guests. Until the last 2 e-mails, it was not
>> clear for me how OP-TEE could ensure this isolation.
> Actually, OP-TEE is running at S-EL1 :-) Only ARM TF (or whatever
> firmware is used) has ultimate control over the system. If we are
> talking about modern ARMv8 platforms.
> 
>> I would advise to explain a bit more in your cover letter of your next
>> version the design of OP-TEE. This would help people to see how this can
>> work with the hypervisor and also understanding the consequence...
> I see. I'll do this, certainly. I just didn't expected that someone will
> be interested in OP-TEE internals at such level.

I like to understand what I sign for :).

> 
> But, I think, cover leter for next OP-TEE will be done much later. Now,
> I'm busy with OP-TEE part, then there will be changes to support
> multi-domain boot and only then OP-TEE specific patches...
> 
> BTW, if anyone is interested in current state of OP-TEE mediator, you
> can find it at [1]. I was able to pass OP-TEE tests from DomU in the
> last version. I use it for OP-TEE development, so it is not
> production-ready.
> 
> Julien, I want to ask about VM monitor feature in XEN. monitor_smc()
> function and whole xen/arch/arm/monitor.c... Looks like it was
> introduced for some sort of debugging. Do you know any users of this

It was originally introduced to allow an external application trapping 
SMC and executing an action. This is part of the VM introspection 
framework that could be used to watch the behavior of the guest (see 
[2]). You could imagine trying to detect malware from outside the VM.

> [1] https://github.com/lorc/xen/tree/optee

[2] https://wiki.xenproject.org/wiki/Virtual_Machine_Introspection

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

      reply	other threads:[~2017-11-07 16:03 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 19:01 [RFC 0/4] TEE mediator framework + OP-TEE mediator Volodymyr Babchuk
2017-10-11 19:01 ` [RFC 1/4] arm: add SMC wrapper that is compatible with SMCCC Volodymyr Babchuk
2017-10-16 14:53   ` Julien Grall
2017-10-11 19:01 ` [RFC 2/4] arm: add generic TEE mediator framework Volodymyr Babchuk
2017-10-16 13:00   ` Julien Grall
2017-10-17 16:22     ` Volodymyr Babchuk
2017-10-17 16:39       ` Julien Grall
2017-10-17 17:22         ` Volodymyr Babchuk
2017-10-17 17:35           ` Julien Grall
2017-10-11 19:01 ` [RFC 3/4] arm: tee: add OP-TEE header files Volodymyr Babchuk
2017-10-16 14:04   ` Julien Grall
2017-10-17 16:24     ` Volodymyr Babchuk
2017-10-17 16:41       ` Julien Grall
2017-10-11 19:01 ` [RFC 4/4] arm: tee: add basic OP-TEE mediator Volodymyr Babchuk
2017-10-16 14:36   ` Julien Grall
2017-10-17 17:08     ` Volodymyr Babchuk
2017-10-17 17:30       ` Julien Grall
2017-10-17 18:57         ` Volodymyr Babchuk
2017-10-19 14:01           ` Julien Grall
2017-10-19 15:33             ` Volodymyr Babchuk
2017-10-19 16:12               ` Julien Grall
2017-10-19 16:37                 ` Volodymyr Babchuk
2017-10-19 16:52                   ` Julien Grall
2017-10-16 12:00 ` [RFC 0/4] TEE mediator framework + " Julien Grall
2017-10-17 15:59   ` Volodymyr Babchuk
2017-10-20 13:11     ` Julien Grall
2017-10-20 16:57       ` Tamas K Lengyel
2017-10-20 17:46         ` Volodymyr Babchuk
2017-10-20 17:37       ` Volodymyr Babchuk
2017-10-23 16:59         ` Julien Grall
2017-10-23 20:11           ` Volodymyr Babchuk
2017-10-23 21:26             ` Stefano Stabellini
2017-10-24 16:33               ` Volodymyr Babchuk
2017-10-24 21:33                 ` Stefano Stabellini
2017-10-27 13:47                   ` Julien Grall
2017-10-27 19:59                     ` Stefano Stabellini
2017-10-27 20:06                       ` Julien Grall
2017-10-24 17:33             ` Julien Grall
2017-10-24 19:02               ` Volodymyr Babchuk
2017-11-02 13:17                 ` Julien Grall
2017-11-02 16:53                   ` Volodymyr Babchuk
2017-11-02 17:49                     ` Julien Grall
2017-11-02 20:07                       ` Volodymyr Babchuk
2017-11-07 16:03                         ` Julien Grall [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=3533f9e7-c9b4-09ee-eee6-c26901e68da1@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=julien.grall@arm.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=volodymyr_babchuk@epam.com \
    --cc=xen-devel@lists.xen.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).