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

Access net device from inside enclave #458

Closed
ahmrr opened this issue Jul 20, 2024 · 2 comments
Closed

Access net device from inside enclave #458

ahmrr opened this issue Jul 20, 2024 · 2 comments

Comments

@ahmrr
Copy link

ahmrr commented Jul 20, 2024

Hello! Thank you for this wonderful project.

I wish to access a net device (SPI CAN bus) from within an enclave. I was looking at @grg-haas's mmio-peripherals branch; is using this version the only way to access a net device, or is there a more straightforward method—preferably one that allows me to use preexisting Linux SPI and CAN drivers?

I would greatly appreciate any help :)

@its-valentinvp
Copy link

Hey @ahmrr,
If you want exclusive access to a device, #418 is the only way to do this now. Since the eyrie runtime is minimal to reduce the TCB, it does not have the functionality that some Linux drivers rely on (e.g. device tree parsing and timer functionality). So, your only option would be to port the Linux drivers to the eyrie runtime, which will be quite challenging. However, we (@f1bu and I) made a comment to #418, where we provided some changes to the PR and also shortly discussed how we did the claiming of a network card (on real hardware). Maybe this is helpful for you.

If you don't need exclusive access to the device and don't mind that the untrusted OS has access to it too, you can activate NET_SYSCALL, IO_SYSCALL or LINUX_SYSCALL in runtime/CMakeLists.txt to get support for some Linux syscalls in the EAPP. A list of available syscalls is in runtime/include/call/io_wrap.h, runtime/include/call/linux_wrap.h and runtime/include/call/net_wrap.h.

@ahmrr
Copy link
Author

ahmrr commented Sep 11, 2024

Thanks @its-valentinvp!

I have written a working driver since I opened the issue, but I do appreciate the extra insight. Your case study is interesting; thanks for documenting it!

@ahmrr ahmrr closed this as completed Sep 20, 2024
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

No branches or pull requests

2 participants