Skip to content

Commit

Permalink
[LibOS/tests] Fix openmp manifest to add shm tmpfs
Browse files Browse the repository at this point in the history
Based on this suggestion by Dmitrii Kuvaiskii:

> @fwoodruff This is a known issue in some versions of `libomp` (the
> LLVM implementation of OpenMP), and I think also in `libiomp` (Intel
> implementation of OpenMP).
>
> You can read about this bug here:
>
>     * [llvm/llvm-project@dafebd5](llvm/llvm-project@dafebd5)
>     * [llvm/llvm-project@102d864](llvm/llvm-project@102d864)
>
> IIUC, it was completely fixed in LLVM OpenMP v18.1.0. I don't know
> whether and how it was fixed in `libiomp`.
>
> I would dissuade you from trying @kailun-qin workaround of enabling
> `untrusted_shm`. Instead, you can do this simple workaround:
>
> ```
> fs.mounts = [
>     ...,
>     { type = "tmpfs", path = "/dev/shm" },
> ]
> ```
>
> This way you are guaranteed that whatever files the OpenMP library
> creates in `/dev/shm/`, these files will **not** be visible on the
> host. So security of your application remains intact.

(#1780 (comment))

Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
  • Loading branch information
woju committed Oct 14, 2024
1 parent 3d2620f commit 5a6b8a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libos/test/regression/openmp.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fs.mounts = [
{ path = "/lib", uri = "file:{{ gramine.runtimedir(libc) }}" },
{ path = "/{{ entrypoint }}", uri = "file:{{ binary_dir }}/{{ entrypoint }}" },
{ path = "/usr/{{ arch_libdir }}", uri = "file:/usr/{{ arch_libdir }}" },
{ path = "/dev/shm", type = "tmpfs" },
]

sgx.max_threads = {{ '1' if env.get('EDMM', '0') == '1' else '32' }}
Expand Down

0 comments on commit 5a6b8a1

Please sign in to comment.