sgx-psw: 2.25 -> 2.27; sgx-azure-dcap-client: 1.12.3 -> 1.13.0-pre0; nixos/aesmd: unbreak; sgx-sdk: drop#489368
Conversation
|
@marcin-serwin Thanks for the review. All comments should be addressed. |
marcin-serwin
left a comment
There was a problem hiding this comment.
LGTM but I have no experience with running this so I'd prefer to have a second opinion before merging.
|
Needed to rebase on master after a repo-wide finalAttrs refactor commit touched a deleted file ( |
|
cc @haraldh are you still using SGX at all? any chance you could give this a test real quick? Thanks! |
|
sorry, only Sev-SNP and TDX |
|
rebased on master |
Updated the
|
e5759b8 to
b3340fa
Compare
b3340fa to
c889d50
Compare
|
I made no changes to code, only commit messages. |
|
This package has been broken and unmaintained since 2024-11, when it broke sometime around the nixos-24.11 release
On our prod machines, aesmd would always fail the first time after boot, with logs like: `XXX-copy-aesmd-data-files.sh[770]: chown: invalid user: 'aesmd:aesmd'`. Everything would be fine after the next restart, but blocking boot for 15 seconds is definitely annoying. It appears the issue was that we were trying to name the DynamicUser User and Group (aesmd/aesmd) during ExecStartPre, but systemd only creates these right before ExecStart. After playing around with the ExecStartPre script, I finally got it to work correctly. As a bonus, we can also re-add the RootDirectory/chroot hardening. I've also cleaned out the config for the old out-of-tree isgx driver and the old DCAP driver. The kernel has had in-kernel SGX support since 5.11 (~2021/02).
|
@mdaniels5757 Good catch, looks like sgx-psw breaks on protobuf_34. I've rebased on master and pinned to protobuf_33 for now. - sgx-psw = callPackage ../os-specific/linux/sgx/psw { };
+ sgx-psw = callPackage ../os-specific/linux/sgx/psw {
+ protobuf = protobuf_33;
+ }; |
|
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-25.11
git worktree add -d .worktree/backport-489368-to-release-25.11 origin/release-25.11
cd .worktree/backport-489368-to-release-25.11
git switch --create backport-489368-to-release-25.11
git cherry-pick -x bbbf5bd268d017d8fd961df945381d4579f12b33 6e4fc8483ea7710891e36f4f13212bf9e707f511 c7beca362be42d9265ee82c6ae3b1c1b51dfdf13 29c30249c30eeddb3f53eb7674c7f0033e10b764 |
Changes
Update the
sgx-pswpackage to the latest 2.27 release.Fix the
aesmdservice, which broke with the update tosystemd-v257(#356818).Update the
sgx-azure-dcap-clientto 1.13.0 (pre-release), which uses the new v4 Intel PCCS API as the prior v2 and v3 API versions are EOL on 2026-04-30.If possible, it would be nice to backport this to release-25.11, as
sgx-psw/aesmdare currently broken on that release.Previous update PRs:
Quick Glossary:
sgx-psw(Platform SoftWare) provides theaesmdservice (Architecture Enclave Service Manager Daemon), which simplifies running enclaves and getting remote attestation quotes.Testing:
These changes were tested on an SGX-enabled Azure gen2 VM (DCSv3) running NixOS.
Run against real SGX hardware
Make sure you're running on a recent x86-64 Intel CPU, against a somewhat recent kernel with the in-tree kernel SGX driver (any NixOS config in the last few years should cover this).
Check the hardware and kernel setup:
In your NixOS
configuration.nix, add something like:After a
nixos-rebuild switch, check that the devices are configured and theaesmdservice is running:Run a test enclave that exercises remote attestation:
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.