[Pal] Rework manifest loading

This is a major refactor of the way manifests are loaded and handled,
which will be followed by a complete rework of the loader code (which
will include e.g. centralized config).

Changes/fixes:
- Huge part of manifest handling was refactored and untangled.
- Starting without a manifest is now disallowed. This was actually
  accidentally broken for some time and no one complained. It also makes
  little sense in practice and in Graphene's overall design, e.g. it
  conflicts with protected argv.
- Now we only allow starting by giving the executable, not manifest (the
  magic resolution logic was removed).
- Now manifests are sent over pipes between parent and children, instead
  of children finding and loading them on their own. This is a
  preparation for the upcoming centralized manifests change.
- Previously manifests were parsed 2 times on Linux and 3 times on
  Linux-SGX (by untrusted PAL, trusted PAL and LibOS). This is now
  fixed.
- The common `pal_main()` now requires that the backend-specific PAL
  loader loads the manifest before calling it. SGX code already has to
  do it (for proper initialization), so let's unify this interface for
  all PALs.
- Fix for a PAL crash when manifest size was divisible by page size
  (sic!). NULL termination was missing, but most of the time the padding
  to page size saved Graphene from crashing.
This commit is contained in:
Michał Kowalczyk
2020-12-03 01:53:01 +01:00
parent cffd457698
commit d53729b201
62 changed files with 652 additions and 887 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ pal_loader:
.PHONY: check
check: all
./pal_loader nodejs.manifest helloworld.js 3000 & SERVER_ID=$$!; \
./pal_loader ./nodejs helloworld.js 3000 & SERVER_ID=$$!; \
sleep 3; \
curl localhost:3000 > OUTPUT; \
kill -9 $$SERVER_ID;