Dear Gramine team,
We hope this message finds you well.
We are a group of researchers from Ruhr University Bochum, Germany, working on a project involving Gramine. As part of our research, we are attempting to compile the project and reproduce the enclave hash on Intel SGX machine (Intel i7-9750H), running on Ubuntu 22.04.
We built the helloworld.c program using two instances of gramine - (1) pre-installed gramine from the provided docker image at https://hub.docker.com/r/gramineproject/gramine and (2) gramine built from source (https://github.com/gramineproject/gramine).
The measurements of the binaries in the two instances did not match. We are following the instructions outlined in the https://gramine.readthedocs.io/en/stable/run-sample-application.html documentation. Furthermore, we did not make any changes to the source codes.
The two output are shown below.
* Gramine built from source:
$ make SGX=1
cc -Wall -Wextra -O3 -c -o helloworld.o helloworld.c
cc helloworld.o -o helloworld
gramine-manifest \
-Dlog_level=error \
helloworld.manifest.template helloworld.manifest
gramine-manifest-check helloworld.manifest
gramine-sgx-sign \
--manifest helloworld.manifest \
--output helloworld.manifest.sgx
Attributes (required for enclave measurement):
size: 0x10000000
edmm: False
max_threads: 4
SGX remote attestation:
None
Memory:
000000000fffd000-0000000010000000 [REG:R--] (manifest) measured
000000000ffdd000-000000000fffd000 [REG:RW-] (ssa) measured
000000000ffd9000-000000000ffdd000 [TCS:---] (tcs) measured
000000000ffd5000-000000000ffd9000 [REG:RW-] (tls) measured
000000000ff95000-000000000ffd5000 [REG:RW-] (stack) measured
000000000ff55000-000000000ff95000 [REG:RW-] (stack) measured
000000000ff15000-000000000ff55000 [REG:RW-] (stack) measured
000000000fed5000-000000000ff15000 [REG:RW-] (stack) measured
000000000fec5000-000000000fed5000 [REG:RW-] (sig_stack) measured
000000000feb5000-000000000fec5000 [REG:RW-] (sig_stack) measured
000000000fea5000-000000000feb5000 [REG:RW-] (sig_stack) measured
000000000fe95000-000000000fea5000 [REG:RW-] (sig_stack) measured
000000000fe3d000-000000000fe8c000 [REG:R-X] (code) measured
000000000fe8c000-000000000fe95000 [REG:RW-] (data) measured
0000000000010000-000000000fe3d000 [REG:RWX] (free)
Measurement:
0589da732e5dc02a4416318ef247403e091bc4eda414942a54ef687936facad2
gramine-manifest-check helloworld.manifest.sgx
* Gramine from the docker:
root@ac0de516f9ea:~/gramine/CI-Examples/helloworld# make SGX=1
cc -Wall -Wextra -O3 -c -o helloworld.o helloworld.c
cc helloworld.o -o helloworld
gramine-manifest \
-Dlog_level=error \
helloworld.manifest.template helloworld.manifest
gramine-manifest-check helloworld.manifest
gramine-sgx-sign \
--manifest helloworld.manifest \
--output helloworld.manifest.sgx
Attributes (required for enclave measurement):
size: 0x10000000
edmm: False
max_threads: 4
SGX remote attestation:
None
Memory:
000000000fffd000-0000000010000000 [REG:R--] (manifest) measured
000000000ffdd000-000000000fffd000 [REG:RW-] (ssa) measured
000000000ffd9000-000000000ffdd000 [TCS:---] (tcs) measured
000000000ffd5000-000000000ffd9000 [REG:RW-] (tls) measured
000000000ff95000-000000000ffd5000 [REG:RW-] (stack) measured
000000000ff55000-000000000ff95000 [REG:RW-] (stack) measured
000000000ff15000-000000000ff55000 [REG:RW-] (stack) measured
000000000fed5000-000000000ff15000 [REG:RW-] (stack) measured
000000000fec5000-000000000fed5000 [REG:RW-] (sig_stack) measured
000000000feb5000-000000000fec5000 [REG:RW-] (sig_stack) measured
000000000fea5000-000000000feb5000 [REG:RW-] (sig_stack) measured
000000000fe95000-000000000fea5000 [REG:RW-] (sig_stack) measured
000000000fe3d000-000000000fe8c000 [REG:R-X] (code) measured
000000000fe8c000-000000000fe95000 [REG:RW-] (data) measured
0000000000010000-000000000fe3d000 [REG:RWX] (free)
Measurement:
96e97ef9679d01a111c0dbb1221899e46e83584a1ed77c0ae95d331eb6caaaf7
gramine-manifest-check helloworld.manifest.sgx
We are reaching out to ask if there are additional steps or considerations we may have missed that could explain the discrepancy in the measurements of the two binaries. Any guidance or insights you can provide would be greatly appreciated.
Thank you for your time and support.
Kind Regards,
Anirban