Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a workaround when fstat() return NOT_SUPPORT #1970

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

lum1n0us
Copy link
Collaborator

The problem was found by a Golang + WAMR(as CGO) wrapped by EGO in a SGX Enclave.

fstat() in EGO returns dummy values.

FYI:

  • EGO use a mount configuration to define mount points that apply the host file system presented to the encalve.

  • EGo has a different programming model: The entire application runs inside the enclave. Manual ECALLs/OCALLs by application code are neither required nor possible.

@lum1n0us lum1n0us force-pushed the if_not_support_fstat branch 3 times, most recently from 8b0ea34 to 1f9c4ab Compare February 20, 2023 00:41
The problem was found by a Golang + WAMR(as CGO) wrapped by EGO in a SGX
Enclave.

`fstat()` in EGO returns dummy values.

FYI:

- EGO use a `mount` configuration to define mount points that
apply the host file system presented to the encalve.

- EGo has a different programming model: The entire application runs inside the enclave.
Manual ECALLs/OCALLs by application code are neither required nor possible.

Now, it is able to specify EGO platform via the CLI:

`$ cmake -S . -B build -DWAMR_BUILD_PALTFORM=ego`
@lum1n0us lum1n0us force-pushed the if_not_support_fstat branch from 1f9c4ab to 6d89539 Compare February 20, 2023 10:51
@lum1n0us lum1n0us marked this pull request as ready for review February 20, 2023 10:51
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 91eafa1 into bytecodealliance:main Feb 21, 2023
@lum1n0us lum1n0us deleted the if_not_support_fstat branch June 26, 2023 01:46
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…iance#1970)

The problem was found by a `Golang + WAMR (as CGO)` wrapped by EGO
in SGX Enclave.

`fstat()` in EGO returns dummy values:
- EGO uses a `mount` configuration to define the mount points that apply
  the host file system presented to the Encalve.
- EGO has a different programming model: the entire application runs inside
  the enclave. Manual ECALLs/OCALLs by application code are neither
  required nor possible.

Add platform ego and add macro control for the return value checking of
`fd_determine_type_rights` in libc-wasi to resolve the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants