All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergej Proskurin <proskurin@sec.in.tum.de>
To: Julien Grall <julien.grall@arm.com>,
	Tamas K Lengyel <tamas.k.lengyel@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM.
Date: Mon, 1 Aug 2016 22:35:58 +0200	[thread overview]
Message-ID: <a9498df8-5bef-7a74-9ea7-ec9c77a1f066@sec.in.tum.de> (raw)
In-Reply-To: <e59a6abe-4020-51f2-9ee3-8beda84487d8@arm.com>

Hi Julien,

On 08/01/2016 09:55 PM, Julien Grall wrote:
> 
> 
> On 01/08/2016 20:20, Tamas K Lengyel wrote:
>> On Mon, Aug 1, 2016 at 12:15 PM, Julien Grall <julien.grall@arm.com>
>> wrote:
>>> On 01/08/16 18:10, Sergej Proskurin wrote:
>>>>
>>>>
>>>> Hello all,
>>>
>>>
>>> Hello Sergej,
>>>
>>>> The following patch series can be found on Github[0] and is part of my
>>>> contribution to this year's Google Summer of Code (GSoC)[1]. My
>>>> project is
>>>> managed by the organization The Honeynet Project. As part of GSoC, I am
>>>> being
>>>> supervised by the Xen developer Tamas K. Lengyel <tamas@tklengyel.com>,
>>>> George
>>>> D. Webster, and Steven Maresca.
>>>>
>>>> In this patch series, we provide an implementation of the altp2m
>>>> subsystem
>>>> for
>>>> ARM. Our implementation is based on the altp2m subsystem for x86,
>>>> providing
>>>> additional --alternate-- views on the guest's physical memory by
>>>> means of
>>>> the
>>>> ARM 2nd stage translation mechanism. The patches introduce new
>>>> HVMOPs and
>>>> extend the p2m subsystem. Also, we extend libxl to support altp2m on
>>>> ARM
>>>> and
>>>> modify xen-access to test the suggested functionality.
>>>>
>>>> To be more precise, altp2m allows to create and switch to additional
>>>> p2m
>>>> views
>>>> (i.e. gfn to mfn mappings). These views can be manipulated and
>>>> activated
>>>> as
>>>> will through the provided HVMOPs. In this way, the active guest
>>>> instance
>>>> in
>>>> question can seamlessly proceed execution without noticing that
>>>> anything
>>>> has
>>>> changed. The prime scope of application of altp2m is Virtual Machine
>>>> Introspection, where guest systems are analyzed from the outside of the
>>>> VM.
>>>>
>>>> Altp2m can be activated by means of the guest control parameter
>>>> "altp2m"
>>>> on x86
>>>> and ARM architectures.  The altp2m functionality by default can also be
>>>> used
>>>> from within the guest by design. For use-cases requiring purely
>>>> external
>>>> access
>>>> to altp2m, a custom XSM policy is necessary on both x86 and ARM.
>>>
>>>
>>> As said on the previous version, altp2m operation *should not* be
>>> exposed to
>>> ARM guest. Any design written for x86 may not fit exactly for ARM
>>> (and vice
>>> versa), you will need to explain why you think we should follow the same
>>> pattern.
>>>
>>> Speaking about security, I skimmed through the series and noticed
>>> that a lot
>>> of my previous comments have not been addressed. For instance there are
>>> still no locking on the altp2m operations and a guest could disable
>>> altp2m.
>>>
>>> I will give a look to the rest of the series once this is fixed.
>>>
>>
>> Julien,
>> we did discuss whether altp2m on ARM should be exposed to guests or
>> not but we did not agree whether restricting it on ARM is absolutely
>> necessary. Altp2m was designed even on the x86 to be accessible from
>> within the guest on all systems irrespective of actual hardware
>> support for it.  Thus, this design fits ARM as well where there is no
>> dedicated hardware support, from the altp2m perspective there is no
>> difference.
> 
> Really? I looked at the design document [1] which is Intel focus.
> Similar think to the code (see p2m_flush_altp2m in arch/x86/mm/p2m.c).
> 
>> The fact that a guest can disable altp2m by default on
>> itself is *not* a security issue - it is by design. There are usecases
>> where the guest is allowed to use altp2m on itself - like having a
>> security kernel module managing VMM memory permissions from within the
>> guest. For use-cases where such operations are undesirable - like in a
>> purely external usecase - the in-guest operations can be readily
>> restricted by XSM. Thus, it is unreasonable to design a completely
>> separate altp2m mode for ARM when the current design from x86 works
>> just as well.
> 
> x86 does not allow to disable the altp2m feature via setparam. Please
> look at the code (see hvmop_set_param in arch/x86/hvm/hvm.c). It is
> clearly an issue that needs to be fixed for ARM which I already pointed
> out in the previous version.
> 

Thank you for pointing that out. The x86 implementation provides an
explicit filter, controlling which HVM params are allowed to be set by
the guest domain. Thus, the implementation restricts re-setting of the
altp2m HVM param.

We have indeed missed that check. I will provide a fix as part of the
next series.

>>
>> If you consider this design unacceptable for ARM we will need the
>> other Maintainers' input on the topic as well before we proceed. It
>> would be possible to introduce another set of domctl's for altp2m and
>> only implement that for ARM, but unless there is strong consensus
>> about that being absolutely necessary, changing the design of altp2m
>> should be avoided. I certainly see no reason to do that right now.
> 
> I don't see any reason to expose the altp2m feature to the guest
> regardless how x86 does. We diverged on some feature between ARM and x86
> because they do not fit (I have in mind the pirq to event channel code).
> Some of the hypercalls are not implemented by ARM for guest...
> 
>>
>> As for locking on altp2m paths, we haven't encountered any issues with
>> the current version during our tests but it is possible we missed
>> something. If you have spotted missed locking, please point it out.
> 
> I already pointed them out in the previous series. Please read the
> comments I made there.
> 
> Regards,
> 
> [1]
> https://lists.xenproject.org/archives/html/xen-devel/2015-06/msg01319.html
> 

Thanks again for the thorough review.

Best regards,
~Sergej

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

  reply	other threads:[~2016-08-01 20:31 UTC|newest]

Thread overview: 159+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 17:10 [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 01/25] arm/altp2m: Add first altp2m HVMOP stubs Sergej Proskurin
2016-08-03 16:54   ` Julien Grall
2016-08-04 16:01     ` Sergej Proskurin
2016-08-04 16:04       ` Julien Grall
2016-08-04 16:22         ` Sergej Proskurin
2016-08-04 16:51           ` Julien Grall
2016-08-05  6:55             ` Sergej Proskurin
2016-08-09 19:16     ` Tamas K Lengyel
2016-08-10  9:52       ` Julien Grall
2016-08-10 14:49         ` Tamas K Lengyel
2016-08-11  8:17           ` Julien Grall
2016-08-11 14:41             ` Tamas K Lengyel
2016-08-12  8:10               ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 02/25] arm/altp2m: Add HVMOP_altp2m_get_domain_state Sergej Proskurin
2016-08-01 17:21   ` Andrew Cooper
2016-08-01 17:34     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 03/25] arm/altp2m: Add struct vttbr Sergej Proskurin
2016-08-03 17:04   ` Julien Grall
2016-08-03 17:05     ` Julien Grall
2016-08-04 16:11       ` Sergej Proskurin
2016-08-04 16:15         ` Julien Grall
2016-08-06  8:54           ` Sergej Proskurin
2016-08-06 13:20             ` Julien Grall
2016-08-06 13:48               ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 04/25] arm/altp2m: Move hostp2m init/teardown to individual functions Sergej Proskurin
2016-08-03 17:40   ` Julien Grall
2016-08-05  7:26     ` Sergej Proskurin
2016-08-05  9:16       ` Julien Grall
2016-08-06  8:43         ` Sergej Proskurin
2016-08-06 13:26           ` Julien Grall
2016-08-06 13:50             ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 05/25] arm/altp2m: Rename and extend p2m_alloc_table Sergej Proskurin
2016-08-03 17:57   ` Julien Grall
2016-08-06  8:57     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 06/25] arm/altp2m: Cosmetic fixes - function prototypes Sergej Proskurin
2016-08-03 18:02   ` Julien Grall
2016-08-06  9:00     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 07/25] arm/altp2m: Add altp2m init/teardown routines Sergej Proskurin
2016-08-03 18:12   ` Julien Grall
2016-08-05  6:53     ` Sergej Proskurin
2016-08-05  9:20       ` Julien Grall
2016-08-06  8:30         ` Sergej Proskurin
2016-08-09  9:44       ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 08/25] arm/altp2m: Add HVMOP_altp2m_set_domain_state Sergej Proskurin
2016-08-03 18:41   ` Julien Grall
2016-08-06  9:03     ` Sergej Proskurin
2016-08-06  9:36     ` Sergej Proskurin
2016-08-06 14:18       ` Julien Grall
2016-08-06 14:21       ` Julien Grall
2016-08-11  9:08       ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 09/25] arm/altp2m: Add altp2m table flushing routine Sergej Proskurin
2016-08-03 18:44   ` Julien Grall
2016-08-06  9:45     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 10/25] arm/altp2m: Add HVMOP_altp2m_create_p2m Sergej Proskurin
2016-08-03 18:48   ` Julien Grall
2016-08-06  9:46     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 11/25] arm/altp2m: Add HVMOP_altp2m_destroy_p2m Sergej Proskurin
2016-08-04 11:46   ` Julien Grall
2016-08-06  9:54     ` Sergej Proskurin
2016-08-06 13:36       ` Julien Grall
2016-08-06 13:51         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 12/25] arm/altp2m: Add HVMOP_altp2m_switch_p2m Sergej Proskurin
2016-08-04 11:51   ` Julien Grall
2016-08-06 10:13     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 13/25] arm/altp2m: Make p2m_restore_state ready for altp2m Sergej Proskurin
2016-08-04 11:55   ` Julien Grall
2016-08-06 10:20     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 14/25] arm/altp2m: Make get_page_from_gva " Sergej Proskurin
2016-08-04 11:59   ` Julien Grall
2016-08-06 10:38     ` Sergej Proskurin
2016-08-06 13:45       ` Julien Grall
2016-08-06 16:58         ` Sergej Proskurin
2016-08-11  8:33           ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 15/25] arm/altp2m: Extend __p2m_lookup Sergej Proskurin
2016-08-04 12:04   ` Julien Grall
2016-08-06 10:44     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 16/25] arm/altp2m: Make p2m_mem_access_check ready for altp2m Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 17/25] arm/altp2m: Cosmetic fixes - function prototypes Sergej Proskurin
2016-08-04 12:06   ` Julien Grall
2016-08-06 10:46     ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 18/25] arm/altp2m: Add HVMOP_altp2m_set_mem_access Sergej Proskurin
2016-08-04 14:19   ` Julien Grall
2016-08-06 11:03     ` Sergej Proskurin
2016-08-06 14:26       ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 19/25] arm/altp2m: Add altp2m_propagate_change Sergej Proskurin
2016-08-04 14:50   ` Julien Grall
2016-08-06 11:26     ` Sergej Proskurin
2016-08-06 13:52       ` Julien Grall
2016-08-06 17:06         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 20/25] arm/altp2m: Add altp2m paging mechanism Sergej Proskurin
2016-08-04 13:50   ` Julien Grall
2016-08-06 12:51     ` Sergej Proskurin
2016-08-06 14:14       ` Julien Grall
2016-08-06 17:28         ` Sergej Proskurin
2016-08-04 16:59   ` Julien Grall
2016-08-06 12:57     ` Sergej Proskurin
2016-08-06 14:21       ` Julien Grall
2016-08-06 17:35         ` Sergej Proskurin
2016-08-10  9:32         ` Sergej Proskurin
2016-08-11  8:47           ` Julien Grall
2016-08-11 17:13             ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 21/25] arm/altp2m: Add HVMOP_altp2m_change_gfn Sergej Proskurin
2016-08-04 14:04   ` Julien Grall
2016-08-06 13:45     ` Sergej Proskurin
2016-08-06 14:34       ` Julien Grall
2016-08-06 17:42         ` Sergej Proskurin
2016-08-11  9:21           ` Julien Grall
2016-08-01 17:10 ` [PATCH v2 22/25] arm/altp2m: Adjust debug information to altp2m Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 23/25] arm/altp2m: Extend libxl to activate altp2m on ARM Sergej Proskurin
2016-08-02 11:59   ` Wei Liu
2016-08-02 14:07     ` Sergej Proskurin
2016-08-11 16:00       ` Wei Liu
2016-08-15 16:07         ` Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 24/25] arm/altp2m: Extend xen-access for " Sergej Proskurin
2016-08-01 17:10 ` [PATCH v2 25/25] arm/altp2m: Add test of xc_altp2m_change_gfn Sergej Proskurin
2016-08-02  9:14   ` Razvan Cojocaru
2016-08-02  9:50     ` Sergej Proskurin
2016-08-01 18:15 ` [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM Julien Grall
2016-08-01 19:20   ` Tamas K Lengyel
2016-08-01 19:55     ` Julien Grall
2016-08-01 20:35       ` Sergej Proskurin [this message]
2016-08-01 20:41       ` Tamas K Lengyel
2016-08-02  7:38         ` Julien Grall
2016-08-02 11:17           ` George Dunlap
2016-08-02 15:48             ` Tamas K Lengyel
2016-08-02 16:05               ` George Dunlap
2016-08-02 16:09                 ` Tamas K Lengyel
2016-08-02 16:40                 ` Julien Grall
2016-08-02 17:01                   ` Tamas K Lengyel
2016-08-02 17:22                   ` Tamas K Lengyel
2016-08-02 16:00           ` Tamas K Lengyel
2016-08-02 16:11             ` Julien Grall
2016-08-02 16:22               ` Tamas K Lengyel
2016-08-01 23:14   ` Andrew Cooper
2016-08-02  7:34     ` Julien Grall
2016-08-02 16:08       ` Andrew Cooper
2016-08-02 16:30         ` Tamas K Lengyel
2016-08-03 11:53         ` Julien Grall
2016-08-03 12:00           ` Andrew Cooper
2016-08-03 12:13             ` Julien Grall
2016-08-03 12:18               ` Andrew Cooper
2016-08-03 12:45                 ` Sergej Proskurin
2016-08-03 14:08                   ` Julien Grall
2016-08-03 14:17                     ` Sergej Proskurin
2016-08-03 16:01                     ` Tamas K Lengyel
2016-08-03 16:24                       ` Julien Grall
2016-08-03 16:42                         ` Tamas K Lengyel
2016-08-03 16:51                           ` Julien Grall
2016-08-03 17:30                             ` Andrew Cooper
2016-08-03 17:43                               ` Tamas K Lengyel
2016-08-03 17:45                                 ` Julien Grall
2016-08-03 17:51                                   ` Tamas K Lengyel
2016-08-03 17:56                                     ` Julien Grall
2016-08-03 18:11                                       ` Tamas K Lengyel
2016-08-03 18:16                                         ` Julien Grall
2016-08-03 18:21                                           ` Tamas K Lengyel
2016-08-04 11:13                                             ` George Dunlap
2016-08-08  4:44                                               ` Tamas K Lengyel

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=a9498df8-5bef-7a74-9ea7-ec9c77a1f066@sec.in.tum.de \
    --to=proskurin@sec.in.tum.de \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas.k.lengyel@gmail.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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.