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

[Pal/Linux-SGX] Disallow creating unknown files #2446

Closed dimakuv closed 3 years ago

dimakuv commented 3 years ago

Description of the changes

Previously, Linux-SGX PAL had a bug of creating any files from within the enclave, even though such files were not listed as allowed or trusted files/paths. This commit fixes this bug, and also disallows opening a trusted file for write/append (because this doesn't make sense and write operations are already disallowed for trusted files).

How to test this PR?

The file_check_policy LibOS regression test is augmented to test this bug fix.


This change is Reviewable