Giter Club home page Giter Club logo

Comments (10)

mkow avatar mkow commented on July 22, 2024

did I miss something ?

Definitely: error checking ;)

Please add and then check where exactly it's failing.

from graphene.

yanzhichao avatar yanzhichao commented on July 22, 2024

I add the debug log, It can ensure that it's failed, when run to int** p2D=malloc2DArray(r,c);

I also try to add the implementation of int **malloc2DArray(int r,int c) in the graphene/Pal/src/host/Linux-SGX/enclave_pf.c directly ,it could work. But I can't work when a split up the code to Separate file fo testmalloc.c.

This confuses me,could you give me some advice? did I need change some code in the makefile ?

from graphene.

mkow avatar mkow commented on July 22, 2024

Sorry, but I didn't understand your whole comment. Could you clean up/reword it?

from graphene.

dimakuv avatar dimakuv commented on July 22, 2024

Why are you adding this malloc2DArray()? What happens if you just add log_debug("after malloc2Darry\n");? Does Graphene-SGX then work all the time, without exceptions?

Why do you use the PPML example? The PPML example is extremely big and complex. You should start with a small test, preferrably written in C. This would give you much better control of what the application and Graphene are doing. Finally, you probably want to debug with GDB.

from graphene.

yanzhichao avatar yanzhichao commented on July 22, 2024

thanks for your reply @dimakuv
Actually,In my scene, all the data is be compressed to a zip file,then encrypt with wrapkey. I want to decrpyt the zip file and unzip to specify pretected directory when get the wrap key for apps. So that app like ppml could read the file directly and no need to unzip.
So, I want to add some code in int set_protected_files_key(const char* pf_key_hex) to implement the function。

I try to port the zlib to Pal for unzip the file, but it's not work. when I run to unzip code, it will raise error as follow:

error: *** Unexpected exception occurred inside PAL at RIP = +0x00000047! ***
error: (untrusted PAL sent PAL event 0x2)
error: rax: 0x00000000 rcx: 0x7ffe43f95093 rdx: 0xff0f9a48 rbx: 0xfaadd4a0
rsp: 0xf2827a08 rbp: 0x00000003 rsi: 0x0000000a rdi: 0x0000000a
r8 : 0xfab1d3f7 r9 : 0xfefefefefefefeff r10: 0x00000000 r11: 0xfaafa67c
r12: 0xfa8a4c00 r13: 0x64cd7cf8 r14: 0x62c9b558 r15: 0xf2827f38
rflags: 0x00010202 rip: 0xfaae1047
debug: DkProcessExit: Returning exit code 1

is there any limits when add code to Pal ?

or for my scene, did you have any suggestion for me ? have any other solution that could decrypt the zip file and unzip it before app running.

from graphene.

dimakuv avatar dimakuv commented on July 22, 2024

is there any limits when add code to Pal ?

No, no limits. As long as the added code is correct, Graphene happily works and doesn't throw exceptions.

or for my scene, did you have any suggestion for me ? have any other solution that could decrypt the zip file and unzip it before app running.

Why are you trying to do this at the level of Graphene source code? Your scenario sounds like a change to TensorFlow scripts, not a change of internal Graphene workings.

from graphene.

yanzhichao avatar yanzhichao commented on July 22, 2024

No, no limits. As long as the added code is correct, Graphene happily works and doesn't throw exceptions.

Ok, I will check my code again.
I submit a commit to my persional rep later. If convenient, help me to review my code.

Why are you trying to do this at the level of Graphene source code? Your scenario sounds like a change to TensorFlow scripts, not a change of internal Graphene workings.

because we want to suitable for any apps which developed by any language and framework.

from graphene.

dimakuv avatar dimakuv commented on July 22, 2024

because we want to suitable for any apps which developed by any language and framework.

You could achieve this in a less intrusive way. I would recommend the premain way: #2347. In this way, your tiny helper program does your "decrypt the zip file" logic and then execves the actual application (which can be any language/framework).

from graphene.

yanzhichao avatar yanzhichao commented on July 22, 2024

Your solution is very excellent, I'll have a try to see if it fits my scene exactly.

from graphene.

yanzhichao avatar yanzhichao commented on July 22, 2024

@dimakuv I take your suggestion to put the unzip logic to premain, and it worked well.
Thanks again, Close.

from graphene.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.