aws / aws-nitro-enclaves-sdk-bootstrap

This project builds the kernel, nsm driver and bootstrap process for AWS Nitro Enclaves.
Apache License 2.0
15 stars 17 forks source link

Modern kernels #26

Open roshanr95 opened 8 months ago

roshanr95 commented 8 months ago

Are there plans to provide images based on modern kernels? E.g. 6.1 (or 5.15) Amazon Linux mainlines, there quite a lot of useful features in the newer kernels.

meerd commented 8 months ago

Hi @roshanr95,

This is on our radar. The NSM driver is already going upstream for Linux 6.8. Although there is no certain date, we will provide newer configurations for the newer kernel versions.

Cottand commented 5 months ago

Hi @meerd - I am trying to boot a Nitro enclave with a 6.8 kernel blob (and its kernel config). The enclave hangs at boot, suggesting it does not even get to initialising the console. Is there anything in Amazon Linux kernels (as opposed to mainline) that is specific to the enclave and is required to boot?

roshanr95 commented 3 months ago

@Cottand you want these enabled on x64, haven't managed to make it work on arm64 yet

CONFIG_VIRTIO_MMIO
CONFIG_VIRTIO_MENU
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES
CONFIG_NET
CONFIG_VSOCKETS
CONFIG_VIRTIO_VSOCKETS
Cottand commented 3 months ago

Thanks @roshanr95 , that helped!

For reference, we have open-sourced a Nitro CLI alternative that allows using modern kernels without having to wait for this repo to provide a new image or a new init binary

see https://github.com/monzo/aws-nitro-util . We have successfully booted a 6.8 Kernel compiled from source in an enclave.

roshanr95 commented 3 months ago

ayo @Cottand, that repo's amazing :heart_eyes:

foersleo commented 1 month ago

We have restructured how we build the binary blobs and are now also offering kernels based on upstream LTS v6.6 series. We plan to improve on the regularity of our kernel updates.

What is still missing at the moment is a new release of the aws-nitro-enclaves-cli to package these newly build binaries.

roshanr95 commented 1 month ago

Trying it out, nix support is great! I assume it's reproducible as well?

roshanr95 commented 1 month ago

@foersleo does it need a different cmdline as well? compared to the existing nitro-cli?

foersleo commented 1 month ago

Hi @roshanr95, I have run the newer kernels without changes to the cmdline. So, I do not think there is a vital part missing.

Do you run into any problems with the newer kernels with the existing cmdline files?

roshanr95 commented 1 month ago

Yes, was facing issues, but it turned out to not be the kernel. It was linuxkit actually, I guess nitro-cli needs to be updated to work with newer versions. Switched to the old linuxkit and everything works now.

foersleo commented 1 month ago

Yes, you are right. Through all of this I have not had too close of an eye on getting all of this out into a cli release.

We have had updated the linuxkit binary shipped with the CLI in the source tree a while ago (https://github.com/aws/aws-nitro-enclaves-cli/commit/04f48e0da1fed413545e39b9574c8b0d466457ae) with the necessary adjustments to work with the new linuxkit.

The new CLI with that linuxkit included was just released today as v1.3.2, although it will be a bit longer until it is available as an rpm through the Amazon Linux package repositories.

A release of the CLI including the new kernel binaries is still pending some additional testing and preparation, and unfortunately I can not share a firm timeline for that yet.

Sorry, for the confusion.

So, to summarize:

I hope this helps. Let me know how we can assist more.

roshanr95 commented 1 month ago

Perfect, thanks!