-
Notifications
You must be signed in to change notification settings - Fork 200
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
mknod with S_IFIFO fails to create FIFO pipe, function call return success does not throw any error #1896
Comments
So this issue has two sub-issues:
The second sub-issue is simple: FIFOs are not normal files, they are actually pipes and thus must be transparently encrypted in Gramine. Since this encryption is per-enclave, there is no sense to expose the FIFO pseudo-file to the host -- this FIFO won't be readable/writable by any other process, other than this SGX enclave. Therefore, Gramine developers made a conscious choice to hide the FIFO pseudo-file from the host, for security reasons (and because functionality-wise exposing FIFOs would be useless anyway). Now for the first issue: why doesn't
Note the missing
So in the end, when the application calls gramine/libos/src/sys/libos_stat.c Lines 24 to 25 in 929bb9d
I can cook a quick patch that adds these callbacks to FIFOs, in a dummy emulated way. I see no reason why not to allow this, and it will unblock applications like the one attached in this issue. |
Description of the problem
mknod with S_IFIFO fails to create the FIFO pipe in gramine, and also does not throw any error, function call return success.
I have attached one sample code which create FIFO PIPE using mknod with S_IFIFO flag, and performing stat operation on the FIFO pipe. the generated FIFO file is not deleted at the end, so we should be able to see the file at the end
Linux Output: We can notice that mknod syscall returns 0
Observation: A new FIFO file
mknod_fifo_test
has been createdmknod_fifo.zip
Steps to reproduce
Download and extract the attached zip file
make SGX=1
gramine-sgx mknod_fifo
Expected results
I have copied the expected results above from Linux native
Actual results
gramine-sgx mknod_fifo: mknod call was successful but stat call failed. Further more we can see that FIFO file is not present
Observation: We don't see mknod_fifo_test being present
Gramine commit hash
929bb9d
The text was updated successfully, but these errors were encountered: