gramine icon indicating copy to clipboard operation
gramine copied to clipboard

[common] Add truncation to arbitrary size to Protected Files

Open dimakuv opened this issue 3 years ago • 1 comments

Description of the changes

Truncation of PFs to arbitrary size is implemented in a slow and trivial way: read the file's contents into a temporary buffer, shrink the file to zero, write back the contents into the file.

Fixes #950.

How to test this PR?

CI. I added tests to libos/test/fs.


This change is Reviewable

dimakuv avatar Oct 12 '22 09:10 dimakuv

We hit this again on a ~~MariaDB~~ MongoDB workload -- without this PR it fails with ftruncate: Permission denied on a Protected File. With this PR, it succeeds initialization and continues working.

We should prioritize finishing this PR.

dimakuv avatar Jul 06 '23 13:07 dimakuv