[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/altp2m: Add a subop for obtaining the mem access of a page


  • To: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
  • Date: Mon, 9 Jul 2018 10:50:28 -0400
  • Autocrypt: addr=proskurin@xxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsFNBFQpTPYBEADCoSruTkW7q3AwG6+hPu9lsYC1NUTihxMX8KcNWGP3ejtRA8N2sqPkZN1b Je8iEIey6//8KiWF8z06ykwopMtgqoUYFshEtrscYE37fuHdnjBJtiLFxabeMNCMuFG7RrB9 ctWwSMY/nzLqCH/gCQ6otfZTIHpYrU+7lDpp5tKa5LyxfPeLut7zWigfcZ4HTLTu5zpssGKu cGKIvcPc4aPUUTd4TuMQL91B4QiNYpudrtkUSFVMtTKF+3Oh/s9ip9b0y4xMuXd2qQLSzCRO tt+mT6iMhKfv/jH/B77noXE0y54bgAUJsEDQ95Rdyw5Tmc676aCmThqgycCvHDMQI/zUzWlT 9RreoKK66EJIemPFFS+G15NW0DEX/rZXRmmH8Upnw7dOhJfNsKqV1CzsuPUHVm3ndNP9kN73 xJSMCPsY+rdBP8nYGlDi7lgvzSbw4QfA+bD4Qb2IaCtFeSCFR5rUVK3NfU9wa6E/Zo6y1K3E IXvrja4fGloNujJH3AMO7rm2zinQuMABtL95Kn1/3mhUtmdo3RL8bs8fjbkUtXBfD0/tlQ4P Lc1IwLJHM+CIa+UjSk5w1CcUEYMVWUKxAX1IdYl1pMs2cZb/ZQ5XRWRsVDRL5386P3MJAJ6Q kVhaG0af8vG1EKtMtP0GGMXEOXTIrUlV9INcBrkC/CsIpvedfQARAQABzUhTZXJnZWogUHJv c2t1cmluIChDaGFpciBmb3IgSVQtU2VjdXJpdHkgLSBUVU0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1BenDkoppWgDa7mIoMvpWUEBLGbs7JXvsisHB 8qN8ZA5i5oqblS1FOIGXklzTzbMCSAHZHh7TDgprnMEkq8O8P3euDXD7Jqo6g/MDR5mO4sQP 6Tc5iSRCo87CQG+k+g==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Adrian Pop <apop@xxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>
  • Delivery-date: Mon, 09 Jul 2018 14:50:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Openpgp: preference=signencrypt

Hi all,

as I am currently working on a concept that uses the #VE functionality
from inside of the unprivileged guest domain myself, I would like to add
my opinion to the discussion.


On 07/09/2018 07:53 AM, Razvan Cojocaru wrote:
> On 07/09/2018 02:46 PM, George Dunlap wrote:
>> On 07/09/2018 12:18 PM, Razvan Cojocaru wrote:
>>> On 07/09/2018 02:04 PM, George Dunlap wrote:
>>>> On 07/06/2018 05:52 PM, Tamas K Lengyel wrote:
>>>>> On Fri, Jul 6, 2018 at 2:56 AM Razvan Cojocaru
>>>>> <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>>>>>> On 07/05/2018 07:45 PM, Tamas K Lengyel wrote:
>>>>>>> On Thu, Jul 5, 2018 at 9:22 AM Razvan Cojocaru
>>>>>>> <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>>>>>>>> However, our particular application is only interested in setting (and
>>>>>>>> querying) page restrictions from userspace (from the dom0 agent). It
>>>>>>>> will also need to be able to set the convertible bit of guest pages 
>>>>>>>> from
>>>>>>>> the dom0 agent as well (patches pending). So we're also fine with a
>>>>>>>> "DOMCTL if nobody wants it as a HVMOP" policy, if polluting the DOMCTLs
>>>>>>>> (possibly temporarily) is an option.
>>>>>>>>
>>>>>>>> We could also (at least between Tamas and us) come up with current /
>>>>>>>> likely use-cases and downgrade all altp2m HVMOPs that could be DOMCTLs
>>>>>>>> in all the scenarios to DOMCTLs.
>>>>>>> Aye. There is really just one HVMOP that the guest absolutely needs
>>>>>>> access to so that it can use #VE, and that's
>>>>>>> HVMOP_altp2m_vcpu_enable_notify. AFAIU everything else could be just a
>>>>>>> DOMCTL.
>>>>>> We need even less than that - we want to modify
>>>>>> HVMOP_altp2m_vcpu_enable_notify to be able to call it from dom0 as well,
>>>>>> and we don't call it from the in-guest agent ever. Because we agree that
>>>>>> the smallest attack surface is a requirement, all we ever call that's
>>>>>> #VE / altp2m related is actually from the privileged domain doing
>>>>>> introspection. The in-guest driver only needs to do VMFUNC and be able
>>>>>> to communicate with the dom0 introspection agent.
>>>> For some reason my impression was that Intel was hoping to be able to
>>>> enable a guest-only usage as well -- that basically a guest which had
>>>> been booted (say) with measured boot, and then wrote its own enclave
>>>> using #VE and altp2ms, should be able to allow an in-guest agent to be
>>>> reasonably secure and also keep tabs on the operating system.  Was this
>>>> not your impression?

I absolutely agree upon that Intel was building a system that allows
guest domains to enable and control the #VE (including the funcitonality
to set up different altp2ms). Although this functionality has not been
widely adopted (yet?), I personally would prefer a hybrid solution that
does not completely prohibit this concept from inside of the
unprivileged guest domain. I agree with Tamas upon the fact that some
concepts can be equally implemented by using the guest's page tables
only. However, (I understand that I am biased, as I am working on a
concept that makes use of this functionality from inside of domu), I
also believe that we can apply the functionality given by #VE and VMFUNC
from inside the guest to harden certain system resources. As such, I
would be happy to see a hybrid solution that allows this feature to be
configured either for unlimited or for external use only.

Best,
~Sergej



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.