gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 260 forks source link

[Meson] vDSO doesn't have the `.note` section #2572

Open dimakuv opened 3 years ago

dimakuv commented 3 years ago

Description of the problem

Extracted from https://github.com/oscarlab/graphene/issues/2420. Comment from @boryspoplawski:

I've just checked and libQt5 from Ubuntu20.04 requires version 3.17.0 and we report 4.19.0 in our vdso... OTOH our uname emulation reports 3.10.0, so maybe this is the problem. After checking it seems that we do not have that .note section in our vDSO. Seems like our recent Meson rewrite broke it. @woju please fix :)

We should choose one version (I vote for 4.15.0 -- this is the default version on Ubuntu 18.04) and return it in both vDSO note section and in uname. We should also probably add some Graphene identifier as well.

Nirusu commented 3 years ago

We should also probably add some Graphene identifier as well.

+1 for this, would be helpful if you actually want to detect which LibOS is currently being used.

One approach I saw in Mystikos was that they chose their values reported by uname in a fashion to which version of the syscall interface they try to be compatible to, see: https://github.com/deislabs/mystikos/blob/dcbd7a3c17816b104ca7497a1e5af45d05e5ab3c/kernel/syscall.c#L2112

I think this is a neat approach. Report the version supposed to be compatible too, but also report in another field of the struct that this is actually also Graphene, not just any Linux. But yeah, should be constant across vDSO, uname and maybe even other locations.