Skip to content

Commit

Permalink
[LibOS] Make sure LibOS doesn't have the executable stack flag
Browse files Browse the repository at this point in the history
This ensures that the LibOS binary (`libsysdb.so`) is not incorrectly
marked as requiring executable stack.

Note that this doesn't have any visible effect right now: our ELF loader
does not respect the relevant program header (`GNU_STACK`), and under
SGX 1, we need to map all memory as RWX anyway.

Technical details: The linker clears the executable stack flag for a
binary only if none of the `.o` files require it. This is determined
automatically for C sources, but when compiling assembly, we need to
pass an extra `-Wa,--noexecstack` flag. This flag is already set
globally, but `vdso-data.o` is a Meson custom target, and doesn't use
global flags.

Signed-off-by: Paweł Marczewski <pawel@invisiblethingslab.com>
  • Loading branch information
pwmarcz committed Oct 3, 2021
1 parent a2e4f1a commit c372c0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions LibOS/shim/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ vdso_data_o = custom_target('vdso-data.o',
command: [
cc.cmd_array(),
cflags_libos,
'-Wa,--noexecstack',
'-DVDSO_SO_FULL_PATH="@0@"'.format(vdso_so.full_path()),
'-c',
'@INPUT@',
Expand Down

0 comments on commit c372c0f

Please sign in to comment.