All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
To: Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xen.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
	Jens Wiklander <jens.wiklander@linaro.org>
Cc: tee-dev@lists.linaro.org
Subject: Re: [PATCH v1 4/6] optee: add OP-TEE mediator
Date: Thu, 23 Aug 2018 17:27:52 +0300	[thread overview]
Message-ID: <926a6612-d514-0f27-4710-d8c6191ab672@epam.com> (raw)
In-Reply-To: <15ce9921-3541-a89a-8257-1bc4a2c83386@arm.com>

Hi,

On 22.08.18 20:28, Julien Grall wrote:
> Hi,
> 
> Please only CC relevant people to the patches. This could be done easily 
> using the new script add_maintainers.pl.
> 
Oh, I'm sorry. I used get_maintainers.pl.

> On 22/08/18 15:11, Volodymyr Babchuk wrote:
>> Add OP-TEE mediator, so guests can access OP-TEE services.
>>
>> OP-TEE mediator support address translation for DomUs.
>> It tracks execution of STD calls, correctly handles memory-related RPC
>> requests, tracks buffer allocated for RPCs.
>>
>> With this patch OP-TEE sucessfully passes own tests, while client is
>> running in DomU.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>> ---
>>
>>   Changes from "RFC":
>>   - Removed special case for Dom0/HwDOM
>>   - No more support for plain OP-TEE (only OP-TEE with virtualization
>>     config enabled is supported)
>>   - Multiple domains is now supported
>>   - Pages that are shared between OP-TEE and domain are now pinned
>>   - Renamed CONFIG_ARM_OPTEE to CONFIG_OPTEE
>>   - Command buffers from domain are now shadowed by XEN
>>   - Mediator now filters out unknown capabilities and requests
>>   - call contexts, shared memory object now stored per-domain
>>
>>   xen/arch/arm/tee/Kconfig            |   4 +
>>   xen/arch/arm/tee/Makefile           |   1 +
>>   xen/arch/arm/tee/optee.c            | 972 
>> ++++++++++++++++++++++++++++++++++++
> 
> This patch is far to big to get a proper review with understanding of 
> the code. Can you split it in smaller ones with appropriate commit message?
> 
Yes, it is a quite big. But this is a complete feature. I can't remove 
anything from it, because it will not work.
I can split it into series of patches, that will add various pieces of 
code... But this will lead to patches with not-working code until the 
final one. Is this okay?

>  From a quick look at it, I would like to understand how the memory 
> allocated in Xen is bounded for a given guest? Same question for the time.

I store references to allocated pages in per-domain context. But they 
are not accounted as a domain memory. This pages are needed by XEN to 
conceal real PAs from guest. I'm not sure it they should be accounted as 
a memory allocated by domain.

And what about a time? Did you mean time accounting?

> I am interested in a normal case but also in the case where someone 
> malicious is using that API. How much damage can it do to the hypervisor?

Every standard (long-lasting) call requires small amount of memory to 
store context. Every shared buffer requires enough memory to store 
references to shared pages.
OP-TEE has limited resources, so it will not allow you to create, say, 
100 calls and couple of GBs of shared memory. I expect that it will 
limit caller in memory overuse.

Apart from that I can't imagine how malicious user can damage the 
hypervisor.


-- 
Volodymyr Babchuk

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

  reply	other threads:[~2018-08-23 14:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 14:11 [PATCH v1 0/6] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
2018-08-22 14:11 ` [PATCH v1 1/6] arm: add SMC wrapper that is compatible with SMCCC Volodymyr Babchuk
2018-08-22 16:46   ` Julien Grall
2018-08-23 14:35     ` Volodymyr Babchuk
2018-08-23 14:45       ` Julien Grall
2018-08-23 15:16         ` Volodymyr Babchuk
2018-08-23 15:31           ` Julien Grall
2018-08-30 14:48     ` Volodymyr Babchuk
2018-08-30 16:43       ` Julien Grall
2018-08-27  6:44   ` Jan Beulich
2018-08-27 19:24     ` Volodymyr Babchuk
2018-08-27 20:19       ` Julien Grall
2018-08-28  6:09       ` Jan Beulich
2018-08-22 14:11 ` [PATCH v1 2/6] arm: add generic TEE mediator framework Volodymyr Babchuk
2018-08-22 17:03   ` Julien Grall
2018-08-27 19:09     ` Volodymyr Babchuk
2018-08-28 11:14       ` Julien Grall
2018-08-22 14:11 ` [PATCH v1 3/6] arm: tee: add OP-TEE header files Volodymyr Babchuk
2018-08-22 14:11 ` [PATCH v1 4/6] optee: add OP-TEE mediator Volodymyr Babchuk
2018-08-22 17:28   ` Julien Grall
2018-08-23 14:27     ` Volodymyr Babchuk [this message]
2018-08-23 15:28       ` Julien Grall
2018-08-22 14:11 ` [PATCH v1 5/6] libxl: create DTS node for OP-TEE if it is enabled Volodymyr Babchuk
2018-08-22 17:03   ` Wei Liu
2018-08-22 17:32   ` Julien Grall
2018-08-23 14:03     ` Volodymyr Babchuk
2018-08-23 14:11       ` Julien Grall
2018-08-23 14:16         ` Volodymyr Babchuk
2018-08-22 14:11 ` [PATCH v1 6/6] xsm: add tee access policy support Volodymyr Babchuk
2018-08-23 13:43   ` Julien Grall
2018-08-23 13:57     ` Volodymyr Babchuk
2018-08-23 14:08       ` Julien Grall

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=926a6612-d514-0f27-4710-d8c6191ab672@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jens.wiklander@linaro.org \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tee-dev@lists.linaro.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.