Re: [PATCH 0/6] Intel Secure Guard Extensions

From: Andy Lutomirski
Date: Tue Apr 26 2016 - 18:36:22 EST


On Tue, Apr 26, 2016 at 2:52 PM, Pavel Machek <pavel@xxxxxx> wrote:
> On Tue 2016-04-26 21:59:52, One Thousand Gnomes wrote:
>> > But... that will mean that my ssh will need to be SGX-aware, and that
>> > I will not be able to switch to AMD machine in future. ... or to other
>> > Intel machine for that matter, right?
>>
>> I'm not privy to AMD's CPU design plans.
>>
>> However I think for the ssl/ssh case you'd use the same interfaces
>> currently available for plugging in TPMs and dongles. It's a solved
>> problem in the crypto libraries.
>>
>> > What new syscalls would be needed for ssh to get all this support?
>>
>> I don't see why you'd need new syscalls.
>
> So the kernel will implement few selected crypto algorithms, similar
> to what TPM would provide, using SGX, and then userspace no longer
> needs to know about SGX?

No, other way around. The kernel will provide a basic interface to
SGX and userspace can do whatever it wants. If userspace wants to use
RSA, userspace will provide an actual RSA implementation, in more or
less normal x86 binary form, and will map it into user addresses. It
will tell the kernel "hey, this address range is an enclave", and the
kernel will set it up as such and tell the CPU about it. Userspace
will then use SGX instructions to communicate with the enclave.

It's pretty neat, and it's completely agnostic to the purpose of the enclave.

--Andy