caml-list - the Caml user's mailing list
 help / Atom feed
* [Caml-list] OCaml and SGX
@ 2018-10-09 16:23 Ivana Vukotic
       [not found] ` <CADK7aFNPm640fvH9CiE=fczqm-3i5FRsoqmAatoFA+LtohF6AA@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Ivana Vukotic @ 2018-10-09 16:23 UTC (permalink / raw)
  To: caml-list; +Cc: Vincent Rahli

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

Hi,

We are trying to run some OCaml code within an Intel SGX enclave.

This OCaml code is called by a C wrapper using the method described
here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html

Because Intel SGX doesn't support the entire standard C library, we had
to create ocalls for the functions that are used by ocamlrun but not
supported by SGX.  Using the functionalities provided by Intel SGX, we
managed to create an .so library containing our OCaml code along with
the C wrapper.  This .so library is what is meant to run in an SGX
enclave (we so far only implemented the ocalls that we needed, and not
all missing functionalities from ocamlrun).

Our problem is now that when we call caml_startup from within our C
wrapper (in order to start the OCaml code), the code seem to simply call
'exit' and stop there.  Does anyone know why this call to caml_startup
would call 'exit'?

We managed to create a simple example, which I can forward to anyone interested
to take a look (unfortunately mailing list has a limited attachment
and I can not
 send it).

Please note that we use ocaml 4.06.1 and gcc 7.3.0

Best,

Ivana

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 1413 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCaml and SGX
       [not found] ` <CADK7aFNPm640fvH9CiE=fczqm-3i5FRsoqmAatoFA+LtohF6AA@mail.gmail.com>
@ 2018-10-11 11:52   ` Ivana Vukotic
  2018-10-11 11:59     ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 4+ messages in thread
From: Ivana Vukotic @ 2018-10-11 11:52 UTC (permalink / raw)
  To: nicolas.ojeda.bar, caml-list

[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]

Dera Nicolas,

Thank you for your suggestion!

Actually I already posted the same question with code on the github:
https://github.com/intel/linux-sgx/issues/315


Best,
Ivana


On Thu, Oct 11, 2018 at 1:42 PM Nicolás Ojeda Bär <
nicolas.ojeda.bar@lexifi.com> wrote:

> Dear Ivana,
>
> You may get more people willing to help if you put up the simple
> example somewhere publicly accessible, such as github.
>
> Best wishes,
> Nicolás
> On Tue, Oct 9, 2018 at 6:23 PM Ivana Vukotic <ivanatodvuk@gmail.com>
> wrote:
> >
> > Hi,
> >
> > We are trying to run some OCaml code within an Intel SGX enclave.
> >
> > This OCaml code is called by a C wrapper using the method described
> > here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
> >
> > Because Intel SGX doesn't support the entire standard C library, we had
> > to create ocalls for the functions that are used by ocamlrun but not
> > supported by SGX.  Using the functionalities provided by Intel SGX, we
> > managed to create an .so library containing our OCaml code along with
> > the C wrapper.  This .so library is what is meant to run in an SGX
> > enclave (we so far only implemented the ocalls that we needed, and not
> > all missing functionalities from ocamlrun).
> >
> > Our problem is now that when we call caml_startup from within our C
> > wrapper (in order to start the OCaml code), the code seem to simply call
> > 'exit' and stop there.  Does anyone know why this call to caml_startup
> > would call 'exit'?
> >
> > We managed to create a simple example, which I can forward to anyone
> interested
> > to take a look (unfortunately mailing list has a limited attachment and
> I can not
> >  send it).
> >
> > Please note that we use ocaml 4.06.1 and gcc 7.3.0
> >
> > Best,
> >
> > Ivana
>

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 2641 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCaml and SGX
  2018-10-11 11:52   ` Ivana Vukotic
@ 2018-10-11 11:59     ` Nicolás Ojeda Bär
  2018-10-11 14:03       ` Ivana Vukotic
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolás Ojeda Bär @ 2018-10-11 11:59 UTC (permalink / raw)
  To: ivanatodvuk; +Cc: OCaml Mailing List

Dear Ivana,

There doesn't seem to be any call to caml_startup in the code you posted.

Regards,
Nicolás
On Thu, Oct 11, 2018 at 1:52 PM Ivana Vukotic <ivanatodvuk@gmail.com> wrote:
>
> Dera Nicolas,
>
> Thank you for your suggestion!
>
> Actually I already posted the same question with code on the github:
> https://github.com/intel/linux-sgx/issues/315
>
>
> Best,
> Ivana
>
>
> On Thu, Oct 11, 2018 at 1:42 PM Nicolás Ojeda Bär <nicolas.ojeda.bar@lexifi.com> wrote:
>>
>> Dear Ivana,
>>
>> You may get more people willing to help if you put up the simple
>> example somewhere publicly accessible, such as github.
>>
>> Best wishes,
>> Nicolás
>> On Tue, Oct 9, 2018 at 6:23 PM Ivana Vukotic <ivanatodvuk@gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > We are trying to run some OCaml code within an Intel SGX enclave.
>> >
>> > This OCaml code is called by a C wrapper using the method described
>> > here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
>> >
>> > Because Intel SGX doesn't support the entire standard C library, we had
>> > to create ocalls for the functions that are used by ocamlrun but not
>> > supported by SGX.  Using the functionalities provided by Intel SGX, we
>> > managed to create an .so library containing our OCaml code along with
>> > the C wrapper.  This .so library is what is meant to run in an SGX
>> > enclave (we so far only implemented the ocalls that we needed, and not
>> > all missing functionalities from ocamlrun).
>> >
>> > Our problem is now that when we call caml_startup from within our C
>> > wrapper (in order to start the OCaml code), the code seem to simply call
>> > 'exit' and stop there.  Does anyone know why this call to caml_startup
>> > would call 'exit'?
>> >
>> > We managed to create a simple example, which I can forward to anyone interested
>> > to take a look (unfortunately mailing list has a limited attachment and I can not
>> >  send it).
>> >
>> > Please note that we use ocaml 4.06.1 and gcc 7.3.0
>> >
>> > Best,
>> >
>> > Ivana

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] OCaml and SGX
  2018-10-11 11:59     ` Nicolás Ojeda Bär
@ 2018-10-11 14:03       ` Ivana Vukotic
  0 siblings, 0 replies; 4+ messages in thread
From: Ivana Vukotic @ 2018-10-11 14:03 UTC (permalink / raw)
  To: nicolas.ojeda.bar; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2637 bytes --]

Dear Nicolas,

The call to caml_startup can be find in Enclave/Enclave.c

Best regards,
Ivana

On Thu, Oct 11, 2018 at 1:59 PM Nicolás Ojeda Bär <
nicolas.ojeda.bar@lexifi.com> wrote:

> Dear Ivana,
>
> There doesn't seem to be any call to caml_startup in the code you posted.
>
> Regards,
> Nicolás
> On Thu, Oct 11, 2018 at 1:52 PM Ivana Vukotic <ivanatodvuk@gmail.com>
> wrote:
> >
> > Dera Nicolas,
> >
> > Thank you for your suggestion!
> >
> > Actually I already posted the same question with code on the github:
> > https://github.com/intel/linux-sgx/issues/315
> >
> >
> > Best,
> > Ivana
> >
> >
> > On Thu, Oct 11, 2018 at 1:42 PM Nicolás Ojeda Bär <
> nicolas.ojeda.bar@lexifi.com> wrote:
> >>
> >> Dear Ivana,
> >>
> >> You may get more people willing to help if you put up the simple
> >> example somewhere publicly accessible, such as github.
> >>
> >> Best wishes,
> >> Nicolás
> >> On Tue, Oct 9, 2018 at 6:23 PM Ivana Vukotic <ivanatodvuk@gmail.com>
> wrote:
> >> >
> >> > Hi,
> >> >
> >> > We are trying to run some OCaml code within an Intel SGX enclave.
> >> >
> >> > This OCaml code is called by a C wrapper using the method described
> >> > here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
> >> >
> >> > Because Intel SGX doesn't support the entire standard C library, we
> had
> >> > to create ocalls for the functions that are used by ocamlrun but not
> >> > supported by SGX.  Using the functionalities provided by Intel SGX, we
> >> > managed to create an .so library containing our OCaml code along with
> >> > the C wrapper.  This .so library is what is meant to run in an SGX
> >> > enclave (we so far only implemented the ocalls that we needed, and not
> >> > all missing functionalities from ocamlrun).
> >> >
> >> > Our problem is now that when we call caml_startup from within our C
> >> > wrapper (in order to start the OCaml code), the code seem to simply
> call
> >> > 'exit' and stop there.  Does anyone know why this call to caml_startup
> >> > would call 'exit'?
> >> >
> >> > We managed to create a simple example, which I can forward to anyone
> interested
> >> > to take a look (unfortunately mailing list has a limited attachment
> and I can not
> >> >  send it).
> >> >
> >> > Please note that we use ocaml 4.06.1 and gcc 7.3.0
> >> >
> >> > Best,
> >> >
> >> > Ivana
>

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 3612 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 16:23 [Caml-list] OCaml and SGX Ivana Vukotic
     [not found] ` <CADK7aFNPm640fvH9CiE=fczqm-3i5FRsoqmAatoFA+LtohF6AA@mail.gmail.com>
2018-10-11 11:52   ` Ivana Vukotic
2018-10-11 11:59     ` Nicolás Ojeda Bär
2018-10-11 14:03       ` Ivana Vukotic

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox